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
commite5cfa6df8a75f8f6f60f4ab5d62e1a0a954e0ee3 (patch)
treed465df5143fde53d4ef26dcfeea82e7bfca9ddd2 /eclass
parentunmask openoffice-bin-1.1.0 (diff)
downloadhistorical-e5cfa6df8a75f8f6f60f4ab5d62e1a0a954e0ee3.tar.gz
historical-e5cfa6df8a75f8f6f60f4ab5d62e1a0a954e0ee3.tar.bz2
historical-e5cfa6df8a75f8f6f60f4ab5d62e1a0a954e0ee3.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