Add PORTAGE_BIN_PATH and PORTAGE_PYM_PATH to the enviroment and use them to replace...
authorZac Medico <zmedico@gentoo.org>
Sun, 30 Apr 2006 08:38:20 +0000 (08:38 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 30 Apr 2006 08:38:20 +0000 (08:38 -0000)
svn path=/main/trunk/; revision=3280

bin/ebuild.sh
bin/misc-functions.sh
pym/portage.py

index 071bd7856b03d29cd6ba735a4db7e64c34fa817d..7e04c04bae6912591870f1ff38ae51813632d939 100755 (executable)
@@ -3,7 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.201.2.42 2005/08/20 17:24:30 jstubbs Exp $
 
-export SANDBOX_PREDICT="${SANDBOX_PREDICT}:/proc/self/maps:/dev/console:/usr/lib/portage/pym:/dev/random"
+PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
+PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}"
+declare -rx PORTAGE_BIN_PATH PORTAGE_PYM_PATH
+
+export SANDBOX_PREDICT="${SANDBOX_PREDICT}:/proc/self/maps:/dev/console:${PORTAGE_PYM_PATH}:/dev/random"
 export SANDBOX_WRITE="${SANDBOX_WRITE}:/dev/shm:/dev/stdout:/dev/stderr:${PORTAGE_TMPDIR}"
 export SANDBOX_READ="${SANDBOX_READ}:/dev/shm:/dev/stdin:${PORTAGE_TMPDIR}"
 
@@ -55,10 +59,10 @@ fi
 [ ! -z "$OCC" ] && export CC="$OCC"
 [ ! -z "$OCXX" ] && export CXX="$OCXX"
 
-export PATH="/usr/local/sbin:/sbin:/usr/sbin:/usr/lib/portage/bin:/usr/local/bin:/bin:/usr/bin:${ROOTPATH}"
+export PATH="/usr/local/sbin:/sbin:/usr/sbin:${PORTAGE_BIN_PATH}:/usr/local/bin:/bin:/usr/bin:${ROOTPATH}"
 [ ! -z "$PREROOTPATH" ] && export PATH="${PREROOTPATH%%:}:$PATH"
 
-source /usr/lib/portage/bin/isolated-functions.sh  &>/dev/null
+source "${PORTAGE_BIN_PATH}/isolated-functions.sh"  &>/dev/null
 
 case "${NOCOLOR:-false}" in
        yes|true)
@@ -158,7 +162,7 @@ has_version() {
        fi
        # return shell-true/shell-false if exists.
        # Takes single depend-type atoms.
-       if /usr/lib/portage/bin/portageq 'has_version' "${ROOT}" "$1"; then
+       if "${PORTAGE_BIN_PATH}/portageq" 'has_version' "${ROOT}" "$1"; then
                return 0
        else
                return 1
@@ -169,7 +173,7 @@ portageq() {
        if [ "${EBUILD_PHASE}" == "depend" ]; then
                die "portageq calls are not allowed in the global scope"
        fi
-       /usr/lib/portage/bin/portageq "$@"
+       "${PORTAGE_BIN_PATH}/portageq" "$@"
 }
 
 
@@ -184,7 +188,7 @@ best_version() {
        fi
        # returns the best/most-current match.
        # Takes single depend-type atoms.
-       /usr/lib/portage/bin/portageq 'best_version' "${ROOT}" "$1"
+       "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1"
 }
 
 use_with() {
index 50d9e03793361744bb1ae2aeec50170883ae3109..0a4c9ff94ab64cf2c1722e23239fc04beefcfb8d 100755 (executable)
@@ -14,7 +14,8 @@
 # XXX hack: clear the args so ebuild.sh doesn't see them
 MISC_FUNCTIONS_ARGS="$@"
 shift $#
-source /usr/lib/portage/bin/ebuild.sh
+
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh"
 
 install_qa_check() {
 
index 1acfed746df6a730c65e96300f1348df9f6cc51e..f8c599c1b2ffd0398b073bfd79cebdcd6cd89987 100644 (file)
@@ -1293,6 +1293,8 @@ class config:
                        writemsg("!!! Error: ROOT '%s' is not a directory. Please correct this.\n" % myroot[:-1])
                        raise portage_exception.DirectoryNotFound(myroot)
                self.backupenv["ROOT"] = myroot
+               self.backupenv["PORTAGE_BIN_PATH"] = PORTAGE_BIN_PATH
+               self.backupenv["PORTAGE_PYM_PATH"] = PORTAGE_PYM_PATH
 
                self._init_dirs()