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.5 2006/01/24 20:21:37 vivo Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.6 2006/01/30 17:51:47 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 |
… | |
… | |
108 | [[ -z "${want_s}" ]] && die "mysql_version_is_at_least missing value" |
108 | [[ -z "${want_s}" ]] && die "mysql_version_is_at_least missing value" |
109 | [[ ${want_s} -le ${have_s} ]] && return 0 || return 1 |
109 | [[ ${want_s} -le ${have_s} ]] && return 0 || return 1 |
110 | } |
110 | } |
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 | mysql_make_file_list() { |
114 | mysql_make_file_list() { |
114 | local items= left=0 |
115 | local items= left=0 |
115 | items=( ${1}-[[:digit:]][[:digit:]][[:digit:]] ) |
116 | items=( ${1}-[[:digit:]][[:digit:]][[:digit:]] ) |
116 | [[ "${items}" == "${1}-[[:digit:]][[:digit:]][[:digit:]]" ]] && items=( ) |
117 | [[ "${items}" == "${1}-[[:digit:]][[:digit:]][[:digit:]]" ]] && items=( ) |
117 | |
118 | |
… | |
… | |
129 | left=$(( ${left} + 1 )) |
130 | left=$(( ${left} + 1 )) |
130 | done |
131 | done |
131 | echo ${items[@]} |
132 | echo ${items[@]} |
132 | } |
133 | } |
133 | |
134 | |
|
|
135 | # THERE IS A COPY OF THIS ONE IN ESELECT-MYSQL, keep the two synced |
134 | mysql_choose_better_version() { |
136 | mysql_choose_better_version() { |
135 | local items= better="" i |
137 | local items= better="" i |
136 | items="$( ls ${1}-[[:digit:]][[:digit:]][[:digit:]] )" |
138 | items="$( ls ${1}-[[:digit:]][[:digit:]][[:digit:]] )" |
137 | for i in ${items} ; do |
139 | for i in ${items} ; do |
138 | if [[ "${i}" > "${better}" ]] ; then |
140 | if [[ "${i}" > "${better}" ]] ; then |
… | |
… | |
146 | # void mysql_lib_symlinks() |
148 | # void mysql_lib_symlinks() |
147 | # |
149 | # |
148 | # To be called on the live filesystem, reassign symlinks to each mysql |
150 | # To be called on the live filesystem, reassign symlinks to each mysql |
149 | # library to the best version avaiable |
151 | # library to the best version avaiable |
150 | # 2005-12-30 <vivo at gentoo.org> |
152 | # 2005-12-30 <vivo at gentoo.org> |
|
|
153 | # THERE IS A COPY OF THIS ONE IN ESELECT-MYSQL, keep the two synced |
151 | mysql_lib_symlinks() { |
154 | mysql_lib_symlinks() { |
152 | local d dirlist maxdots soname sonameln other better |
155 | local d dirlist maxdots soname sonameln other better |
153 | pushd "${ROOT}/usr/$(get_libdir)/" &> /dev/null |
156 | pushd "${ROOT}/usr/$(get_libdir)/" &> /dev/null |
154 | # dirlist must contain the less significative directory left |
157 | # dirlist must contain the less significative directory left |
155 | dirlist="mysql $( mysql_make_file_list mysql )" |
158 | dirlist="mysql $( mysql_make_file_list mysql )" |