/[gentoo-x86]/eclass/mysql_fx.eclass
Gentoo

Diff of /eclass/mysql_fx.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.4 Revision 1.5
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.4 2006/01/24 19:14:00 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.5 2006/01/24 20:21:37 vivo Exp $
4 4
5# Author: Francesco Riosa <vivo at gentoo.org> 5# Author: Francesco Riosa <vivo at gentoo.org>
6# Maintainer: Francesco Riosa <vivo at gentoo.org> 6# Maintainer: Francesco Riosa <vivo at gentoo.org>
7 7
8# helper function, version (integer) may have section separated by dots 8# helper function, version (integer) may have section separated by dots
131 echo ${items[@]} 131 echo ${items[@]}
132} 132}
133 133
134mysql_choose_better_version() { 134mysql_choose_better_version() {
135 local items= better="" i 135 local items= better="" i
136 items=${1}-[[:digit:]][[:digit:]][[:digit:]] 136 items="$( ls ${1}-[[:digit:]][[:digit:]][[:digit:]] )"
137 [[ "${items}" == "${1}-[[:digit:]][[:digit:]][[:digit:]]" ]] && items=""
138 for i in ${items} ; do 137 for i in ${items} ; do
139 if [[ "${i}" > "${better}" ]] ; then 138 if [[ "${i}" > "${better}" ]] ; then
140 better="${i}" 139 better="${i}"
141 fi 140 fi
142 done 141 done
149# To be called on the live filesystem, reassign symlinks to each mysql 148# To be called on the live filesystem, reassign symlinks to each mysql
150# library to the best version avaiable 149# library to the best version avaiable
151# 2005-12-30 <vivo at gentoo.org> 150# 2005-12-30 <vivo at gentoo.org>
152mysql_lib_symlinks() { 151mysql_lib_symlinks() {
153 local d dirlist maxdots soname sonameln other better 152 local d dirlist maxdots soname sonameln other better
154 pushd "${ROOT}/usr/$(get_libdir)/" 153 pushd "${ROOT}/usr/$(get_libdir)/" &> /dev/null
155 # dirlist must contain the less significative directory left 154 # dirlist must contain the less significative directory left
156 dirlist="mysql (mysql_make_file_list mysql)" 155 dirlist="mysql $( mysql_make_file_list mysql )"
157 156
158 # waste some time in removing and recreating symlinks 157 # waste some time in removing and recreating symlinks
159 for d in $dirlist ; do 158 for d in $dirlist ; do
160 for soname in $(find "${d}" -name "*.so*" -and -not -type "l") ; do 159 for soname in $(find "${d}" -name "*.so*" -and -not -type "l") ; do
161 # maxdot is a limit versus infinite loop 160 # maxdot is a limit versus infinite loop
172 done 171 done
173 rm -f "${sonameln}" 172 rm -f "${sonameln}"
174 ln -s "${soname}" "${sonameln}" 173 ln -s "${soname}" "${sonameln}"
175 done 174 done
176 done 175 done
177 popd 176 popd &> /dev/null
178 177
179 # "include"s and "mysql_config", needed to compile other sw 178 # "include"s and "mysql_config", needed to compile other sw
180 for other in "/usr/include/mysql" "/usr/bin/mysql_config" ; do 179 for other in "/usr/include/mysql" "/usr/bin/mysql_config" ; do
181 pushd "${ROOT}${other%/*}" &> /dev/null 180 pushd "${ROOT}${other%/*}" &> /dev/null
182 if ! [[ -d "${other##*/}" ]] ; then 181 if ! [[ -d "${other##*/}" ]] ; then

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20