For bug #170178, remove all hardcoded references to '/usr/lib/portage'.
authorZac Medico <zmedico@gentoo.org>
Sat, 10 Mar 2007 00:08:13 +0000 (00:08 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 10 Mar 2007 00:08:13 +0000 (00:08 -0000)
svn path=/main/trunk/; revision=6203

bin/emerge-webrsync
bin/etc-update
pym/portage/dbapi/vartree.py
pym/portage/locks.py

index 24fc377c2618e4118d81476e24def54ca96651ca..7602deab59094f98408272e52209ee23a9b33565 100755 (executable)
@@ -5,8 +5,9 @@
 # Author: Karl Trygve Kalleberg <karltk@gentoo.org>
 # Rewritten from the old, Perl-based emerge-webrsync script
 
-eval $(/usr/lib/portage/bin/portageq envvar -v FEATURES FETCHCOMMAND \
-       GENTOO_MIRRORS PORTAGE_INST_UID PORTAGE_INST_GID PORTAGE_NICENESS \
+type portageq > /dev/null || exit $?
+eval $(portageq envvar -v FEATURES FETCHCOMMAND GENTOO_MIRRORS \
+       PORTAGE_BIN_PATH PORTAGE_INST_UID PORTAGE_INST_GID PORTAGE_NICENESS \
        PORTAGE_TMPDIR PORTDIR PORTAGE_RSYNC_EXTRA_OPTS)
 DISTDIR="${PORTAGE_TMPDIR}/emerge-webrsync"
 
@@ -16,7 +17,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
index c1569ff12150343ba0290879109a89542f7792fc..ab376b83c1a78e9f8514bb32e34205525299808d 100755 (executable)
@@ -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
 
index 59ea9eb4eabd37aa6d59613ff1af194d9f8e30dc..a4c7737d557825c63383ddaef9e925d3a63d7fb4 100644 (file)
@@ -1,5 +1,6 @@
 from portage.checksum import perform_md5
-from portage.const import CACHE_PATH, CONFIG_MEMORY_FILE, PRIVATE_PATH, VDB_PATH
+from portage.const import CACHE_PATH, CONFIG_MEMORY_FILE, PORTAGE_BIN_PATH, \
+       PRIVATE_PATH, VDB_PATH
 from portage.data import portage_gid, portage_uid, secpass
 from portage.dbapi import dbapi
 from portage.dep import dep_getslot, use_reduce, paren_reduce, isvalidatom, \
@@ -98,7 +99,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)
@@ -106,7 +107,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)
index 167109432f3764af6dcaf5347d86908d8e72dc6b..2575a978b5c245a92f0251caf95a34edc82e7ee4 100644 (file)
@@ -231,10 +231,11 @@ def hardlink_lockfile(lockfilename, max_wait=14400):
                        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)