summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorAlastair Tse <liquidx@gentoo.org>2003-10-07 20:26:50 +0000
committerAlastair Tse <liquidx@gentoo.org>2003-10-07 20:26:50 +0000
commit428da749a654d6be11d36aca71ff179585834b51 (patch)
treeaae39e435a11a5dce195d2d7cf37fcccdfc7380d /eclass
parentunmask openoffice-bin-1.1.0 (diff)
downloadgentoo-2-428da749a654d6be11d36aca71ff179585834b51.tar.gz
gentoo-2-428da749a654d6be11d36aca71ff179585834b51.tar.bz2
gentoo-2-428da749a654d6be11d36aca71ff179585834b51.zip
fixed issues with ${ROOT} on auto_makesym
Diffstat (limited to 'eclass')
-rw-r--r--eclass/alternatives.eclass9
1 files changed, 6 insertions, 3 deletions
diff --git a/eclass/alternatives.eclass b/eclass/alternatives.eclass
index 2c7eecc3897f..329af52877fb 100644
--- a/eclass/alternatives.eclass
+++ b/eclass/alternatives.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/alternatives.eclass,v 1.1 2003/10/07 17:21:40 liquidx Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/alternatives.eclass,v 1.2 2003/10/07 20:26:50 liquidx Exp $
# Author : Alastair Tse <liquidx@gentoo.org> (03 Oct 2003)
# Short Desc: Creates symlink to the latest version of multiple slotted
@@ -52,7 +52,8 @@ alternatives_auto_makesym() {
SOURCE=$1
REGEX=$2
- ALT="`ls -1 ${ROOT}${REGEX} | sort -r | xargs`"
+ ALT="`ls -1 --color=never ${ROOT}${REGEX} | sed -e "s:^${ROOT}::" | sort -r | xargs`"
+ einfo "alternatives: $ROOT $REGEX $ALT"
if [ -n "${ALT}" ]; then
alternatives_makesym ${SOURCE} ${ALT}
else
@@ -78,7 +79,9 @@ alternatives_makesym() {
rm -f ${ROOT}${SOURCE}
fi
einfo "Linking ${alt} to ${SOURCE}"
- ln -s ${alt} ${ROOT}${SOURCE}
+ # we do this instead of ${ROOT}${SOURCE} because if
+ # ROOT=/, then a symlink to //usr/bin/python confuses distutils
+ cd ${ROOT}; ln -s ${alt} ${SOURCE}
break
fi
done