summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Riosa <vivo@gentoo.org>2006-02-05 14:22:46 +0000
committerFrancesco Riosa <vivo@gentoo.org>2006-02-05 14:22:46 +0000
commiteaa8560d1335052b4a8fa1a6b3da48d9cd36df52 (patch)
treeafba7587f642e19921bd0492923c45bd35eb337f /app-admin
parentVersion bump to 0.9.6. Closes bug #117699. (diff)
downloadgentoo-2-eaa8560d1335052b4a8fa1a6b3da48d9cd36df52.tar.gz
gentoo-2-eaa8560d1335052b4a8fa1a6b3da48d9cd36df52.tar.bz2
gentoo-2-eaa8560d1335052b4a8fa1a6b3da48d9cd36df52.zip
Added function slot_remove to be used inside MySQL eclass/ebuild
(Portage version: 2.1_pre4-r1)
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/eselect-mysql/ChangeLog8
-rw-r--r--app-admin/eselect-mysql/eselect-mysql-1.0.0-r2.ebuild (renamed from app-admin/eselect-mysql/eselect-mysql-1.0.0-r1.ebuild)2
-rw-r--r--app-admin/eselect-mysql/files/digest-eselect-mysql-1.0.0-r2 (renamed from app-admin/eselect-mysql/files/digest-eselect-mysql-1.0.0-r1)0
-rw-r--r--app-admin/eselect-mysql/files/mysql.eselect48
4 files changed, 48 insertions, 10 deletions
diff --git a/app-admin/eselect-mysql/ChangeLog b/app-admin/eselect-mysql/ChangeLog
index 9a9797c83f7e..59695ed8852e 100644
--- a/app-admin/eselect-mysql/ChangeLog
+++ b/app-admin/eselect-mysql/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-admin/eselect-mysql
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-mysql/ChangeLog,v 1.7 2006/02/01 15:42:03 vivo Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-mysql/ChangeLog,v 1.8 2006/02/05 14:22:46 vivo Exp $
+
+*eselect-mysql-1.0.0-r2 (05 Feb 2006)
+
+ 05 Feb 2006; Francesco Riosa <vivo@gentoo.org> files/mysql.eselect,
+ -eselect-mysql-1.0.0-r1.ebuild, +eselect-mysql-1.0.0-r2.ebuild:
+ Added function slot_remove to be used inside MySQL eclass/ebuild
*eselect-mysql-1.0.0-r1 (01 Feb 2006)
diff --git a/app-admin/eselect-mysql/eselect-mysql-1.0.0-r1.ebuild b/app-admin/eselect-mysql/eselect-mysql-1.0.0-r2.ebuild
index 8dab974be165..40bde1c09294 100644
--- a/app-admin/eselect-mysql/eselect-mysql-1.0.0-r1.ebuild
+++ b/app-admin/eselect-mysql/eselect-mysql-1.0.0-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-mysql/eselect-mysql-1.0.0-r1.ebuild,v 1.1 2006/02/01 15:42:03 vivo Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-mysql/eselect-mysql-1.0.0-r2.ebuild,v 1.1 2006/02/05 14:22:46 vivo Exp $
DESCRIPTION="Utility to change the default MySQL server being used"
HOMEPAGE="http://www.gentoo.org/"
diff --git a/app-admin/eselect-mysql/files/digest-eselect-mysql-1.0.0-r1 b/app-admin/eselect-mysql/files/digest-eselect-mysql-1.0.0-r2
index e69de29bb2d1..e69de29bb2d1 100644
--- a/app-admin/eselect-mysql/files/digest-eselect-mysql-1.0.0-r1
+++ b/app-admin/eselect-mysql/files/digest-eselect-mysql-1.0.0-r2
diff --git a/app-admin/eselect-mysql/files/mysql.eselect b/app-admin/eselect-mysql/files/mysql.eselect
index a34e581ed91e..23e1f4fc6aa8 100644
--- a/app-admin/eselect-mysql/files/mysql.eselect
+++ b/app-admin/eselect-mysql/files/mysql.eselect
@@ -1,10 +1,10 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Id: mysql.eselect,v 1.6 2006/02/01 15:32:32 vivo Exp $
+# $Id: mysql.eselect,v 1.7 2006/02/05 14:22:46 vivo Exp $
DESCRIPTION="Manage the /usr/lib/*mysql* links"
MAINTAINER="vivo@gentoo.org"
-SVN_DATE='$Date: 2006/02/01 15:32:32 $'
+SVN_DATE='$Date: 2006/02/05 14:22:46 $'
VERSION=$(svn_date_to_version "${SVN_DATE}" )
MYSQL_SYMLINK_CHECKDIR="${ROOT}/usr/sbin"
ERR_NOT_FOUND="(not-found)"
@@ -28,7 +28,7 @@ function version4human() {
function version4bash() {
local minor=${1#*.}
minor=${minor%%.x*}
- [[ ${#minor} -eq 1 ]] && minor="0${minor}"
+ [[ ${#minor} -lt 10 ]] && minor="0${minor}"
echo "${1%%.*}${minor}"
}
@@ -39,7 +39,7 @@ find_versions() {
list=${MYSQL_SYMLINK_CHECKDIR}/mysqld-*
[[ ${list##/} == mysqld-* ]] && return
for x in ${MYSQL_SYMLINK_CHECKDIR}/mysqld-* ; do
- versions=( $(version4human ${x##*-}) ${versions[@]} )
+ versions=( $( version4human ${x##*-}) ${versions[@]} )
done
echo ${versions[@]}
}
@@ -115,7 +115,9 @@ mysql_lib_symlinks() {
# waste some time in removing and recreating symlinks
for d in $dirlist ; do
- for soname in $(find "${d}" -name "*.so*" -and -not -type "l") ; do
+ for soname
+ in $( find "${d}" -name "*.so*" -and -not -type "l" 2>/dev/null)
+ do
# maxdot is a limit versus infinite loop
maxdots=0
sonameln=${soname##*/}
@@ -156,7 +158,7 @@ mysql_lib_symlinks() {
get_version_fromlist() {
local version=${1}
local -a versions=( $(find_versions) )
-
+
if is_number ${version} ; then
if [[ ${version} -gt 0 ]] && [[ ${version} -le ${#versions[@]} ]] ; then
version=${versions[(( ${version} - 1 ))]}
@@ -237,7 +239,7 @@ remove_current_version() {
local CWD=$(pwd)
local lastdir dir linkname
local list=$(< $ROOT/var/lib/eselect/mysql/mysql-${version}.filelist )
-
+
for filename in $list ; do
linkname="${ROOT}/${filename/"-${version}"/}"
[[ -L "${linkname}" ]] && rm -f "${linkname}"
@@ -267,7 +269,7 @@ describe_list() {
do_list() {
versions=( $(find_versions) )
current=$(get_current_version)
-
+
write_list_start "Available MySQL versions:"
if [[ -n "${versions[@]}" ]] ; then
@@ -321,4 +323,34 @@ do_remove() {
mysql_lib_symlinks
}
+### slot_remove action ###
+
+describe_slot_remove() {
+ echo "Remove symlinks given a MySQL slot (used in the ebuild)"
+}
+
+do_slot_remove() {
+
+ [[ ${#@} -lt 1 ]] &&
+ die -q "Wrong count of paramters."
+ local version=$( version4human ${1} )
+ version=$( get_version_fromlist ${version} )
+ local cur_version=$( get_current_version )
+
+ if [[ ${version} == "${ERR_NOT_FOUND}" ]] ; then
+ die -q "I don't recognise that version of MYSQL"
+ fi
+
+ if [[ -z "${version}" ]] ; then
+ die -q "No symlinks found"
+ fi
+
+ if [[ "${version}" != "${cur_version}" ]] ; then
+ die -q "The version specified is not the current one"
+ fi
+
+ remove_current_version "$( version4bash "${version}" )"
+ mysql_lib_symlinks
+}
+
# vim: set ft=eselect :