/[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.6 Revision 1.7
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.6 2006/01/30 17:51:47 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.7 2006/02/01 15:51:44 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
111 111
112# another one inherited from versionator.eclass (version_sort) 112# another one inherited from versionator.eclass (version_sort)
113# THERE IS A COPY OF THIS ONE IN ESELECT-MYSQL, keep the two synced 113# THERE IS A COPY OF THIS ONE IN ESELECT-MYSQL, keep the two synced
114mysql_make_file_list() { 114mysql_make_file_list() {
115 local items= left=0 115 local items= left=0
116 items=( ${1}-[[:digit:]][[:digit:]][[:digit:]] ) 116 items=$( ls -d ${1}-[[:digit:]][[:digit:]][[:digit:]] )
117 [[ "${items}" == "${1}-[[:digit:]][[:digit:]][[:digit:]]" ]] && items=( )
118 117
119 while [[ ${left} -lt ${#items[@]} ]] ; do 118 while [[ ${left} -lt ${#items[@]} ]] ; do
120 local lowest_idx=${left} 119 local lowest_idx=${left}
121 local idx=$(( ${lowest_idx} + 1 )) 120 local idx=$(( ${lowest_idx} + 1 ))
122 while [[ ${idx} -lt ${#items[@]} ]] ; do 121 while [[ ${idx} -lt ${#items[@]} ]] ; do
133} 132}
134 133
135# THERE IS A COPY OF THIS ONE IN ESELECT-MYSQL, keep the two synced 134# THERE IS A COPY OF THIS ONE IN ESELECT-MYSQL, keep the two synced
136mysql_choose_better_version() { 135mysql_choose_better_version() {
137 local items= better="" i 136 local items= better="" i
138 items="$( ls ${1}-[[:digit:]][[:digit:]][[:digit:]] )" 137 items="$( ls -d ${1}-[[:digit:]][[:digit:]][[:digit:]] )"
139 for i in ${items} ; do 138 for i in ${items} ; do
140 if [[ "${i}" > "${better}" ]] ; then 139 if [[ "${i}" > "${better}" ]] ; then
141 better="${i}" 140 better="${i}"
142 fi 141 fi
143 done 142 done
151# library to the best version avaiable 150# library to the best version avaiable
152# 2005-12-30 <vivo at gentoo.org> 151# 2005-12-30 <vivo at gentoo.org>
153# THERE IS A COPY OF THIS ONE IN ESELECT-MYSQL, keep the two synced 152# THERE IS A COPY OF THIS ONE IN ESELECT-MYSQL, keep the two synced
154mysql_lib_symlinks() { 153mysql_lib_symlinks() {
155 local d dirlist maxdots soname sonameln other better 154 local d dirlist maxdots soname sonameln other better
156 pushd "${ROOT}/usr/$(get_libdir)/" &> /dev/null 155 pushd "${ROOT}/usr/lib" &> /dev/null
157 # dirlist must contain the less significative directory left 156 # dirlist must contain the less significative directory left
158 dirlist="mysql $( mysql_make_file_list mysql )" 157 dirlist="mysql $( mysql_make_file_list mysql )"
159 158
160 # waste some time in removing and recreating symlinks 159 # waste some time in removing and recreating symlinks
161 for d in $dirlist ; do 160 for d in $dirlist ; do
177 done 176 done
178 done 177 done
179 popd &> /dev/null 178 popd &> /dev/null
180 179
181 # "include"s and "mysql_config", needed to compile other sw 180 # "include"s and "mysql_config", needed to compile other sw
182 for other in "/usr/include/mysql" "/usr/bin/mysql_config" ; do 181 for other in "/usr/lib/mysql" "/usr/include/mysql" "/usr/bin/mysql_config" ; do
183 pushd "${ROOT}${other%/*}" &> /dev/null 182 pushd "${ROOT}${other%/*}" &> /dev/null
183 better=$( mysql_choose_better_version "${other##*/}" )
184 if ! [[ -d "${other##*/}" ]] ; then 184 if ! [[ -d "${other##*/}" ]] ; then
185 better=$( mysql_choose_better_version "${other##*/}" )
186 [[ -L "${other##*/}" ]] && rm -f "${other##*/}" 185 [[ -L "${other##*/}" ]] && rm -f "${other##*/}"
187 ! [[ -f "${other##*/}" ]] && ln -sf "${better}" "${other##*/}" 186 ! [[ -f "${other##*/}" ]] && ln -sf "${better}" "${other##*/}"
187 else
188 [[ -L "${other##*/}" ]] && rm -f "${other##*/}"
189 ! [[ -d "${other##*/}" ]] && ln -s "${better}" "${other##*/}"
188 fi 190 fi
189 popd &> /dev/null 191 popd &> /dev/null
190 done 192 done
191} 193}

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20