diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-04-30 08:38:20 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-04-30 08:38:20 +0000 |
commit | 70e6dda08c5a169385fbb5e41fa9ea3d07f634fa (patch) | |
tree | 78c4d154c8d82674aae9f152b9304b308e8c02d1 | |
parent | 50411e6d3b8dbf27a95ffe85280712be2594feea (diff) | |
download | portage-70e6dda08c5a169385fbb5e41fa9ea3d07f634fa.tar.gz portage-70e6dda08c5a169385fbb5e41fa9ea3d07f634fa.tar.bz2 portage-70e6dda08c5a169385fbb5e41fa9ea3d07f634fa.zip |
Add PORTAGE_BIN_PATH and PORTAGE_PYM_PATH to the enviroment and use them to replace hard coded paths in ebuild.sh and misc-functions.sh.
svn path=/main/trunk/; revision=3280
-rwxr-xr-x | bin/ebuild.sh | 16 | ||||
-rwxr-xr-x | bin/misc-functions.sh | 3 | ||||
-rw-r--r-- | pym/portage.py | 2 |
3 files changed, 14 insertions, 7 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 071bd7856..7e04c04ba 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -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() { diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 50d9e0379..0a4c9ff94 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -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() { diff --git a/pym/portage.py b/pym/portage.py index 1acfed746..f8c599c1b 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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() |