From ff0dfb0b1072c1d0e14fdcbf58581941baea7bb6 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 27 Mar 2007 20:32:16 +0000 Subject: [PATCH] For bug #170178, remove all hardcoded references to '/usr/lib/portage'. (trunk r6202:6203) svn path=/main/branches/2.1.2/; revision=6293 --- bin/emerge-webrsync | 6 ++++-- bin/etc-update | 4 ++-- pym/portage.py | 4 ++-- pym/portage_locks.py | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index b1362b379..36b8e1307 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -5,7 +5,9 @@ # Author: Karl Trygve Kalleberg # Rewritten from the old, Perl-based emerge-webrsync script -eval $(/usr/lib/portage/bin/portageq envvar -v FEATURES FETCHCOMMAND \ +type portageq > /dev/null || exit $? +eval $(portageq envvar -v FEATURES FETCHCOMMAND GENTOO_MIRRORS \ + PORTAGE_BIN_PATH PORTAGE_INST_UID PORTAGE_INST_GID PORTAGE_NICENESS \ GENTOO_MIRRORS PORTAGE_INST_UID PORTAGE_INST_GID PORTAGE_NICENESS \ PORTAGE_TMPDIR PORTDIR) DISTDIR="${PORTAGE_TMPDIR}/emerge-webrsync" @@ -16,7 +18,7 @@ if [ -n "${PORTAGE_NICENESS}" ]; then renice $PORTAGE_NICENESS $$ > /dev/null fi -source /usr/lib/portage/bin/isolated-functions.sh || exit 1 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 if [ ! -d $DISTDIR ] ; then mkdir -p $DISTDIR diff --git a/bin/etc-update b/bin/etc-update index c1569ff12..ab376b83c 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -439,8 +439,8 @@ scriptname=$(basename $0) trap die term - -eval $(/usr/lib/portage/bin/portageq envvar -v CONFIG_PROTECT \ +type portageq > /dev/null || exit $? +eval $(portageq envvar -v CONFIG_PROTECT \ CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_TMPDIR ROOT USERLAND) export PORTAGE_TMPDIR diff --git a/pym/portage.py b/pym/portage.py index bfe9060da..7c9f995cb 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5001,7 +5001,7 @@ class vardbapi(dbapi): except Exception, e: writemsg("!!! COUNTER file is missing for "+str(mycpv)+" in /var/db.\n", noiselevel=-1) - writemsg("!!! Please run /usr/lib/portage/bin/fix-db.py or\n", + writemsg("!!! Please run %s/fix-db.py or\n" % PORTAGE_BIN_PATH, noiselevel=-1) writemsg("!!! unmerge this exact version.\n", noiselevel=-1) writemsg("!!! %s\n" % e, noiselevel=-1) @@ -5009,7 +5009,7 @@ class vardbapi(dbapi): else: writemsg("!!! COUNTER file is missing for "+str(mycpv)+" in /var/db.\n", noiselevel=-1) - writemsg("!!! Please run /usr/lib/portage/bin/fix-db.py or\n", + writemsg("!!! Please run %s/fix-db.py or\n" % PORTAGE_BIN_PATH, noiselevel=-1) writemsg("!!! remerge the package.\n", noiselevel=-1) sys.exit(1) diff --git a/pym/portage_locks.py b/pym/portage_locks.py index 389adddde..8358b3063 100644 --- a/pym/portage_locks.py +++ b/pym/portage_locks.py @@ -235,10 +235,11 @@ def hardlink_lockfile(lockfilename, max_wait=14400): portage_util.writemsg(".") else: reported_waiting = True + from portage_const import PORTAGE_BIN_PATH print print "Waiting on (hardlink) lockfile: (one '.' per 3 seconds)" print "This is a feature to prevent distfiles corruption." - print "/usr/lib/portage/bin/clean_locks can fix stuck locks." + print "%s/clean_locks can fix stuck locks." % PORTAGE_BIN_PATH print "Lockfile: " + lockfilename time.sleep(3) -- 2.26.2