emerge-webrsync: use portageq from same prefix
authorZac Medico <zmedico@gentoo.org>
Tue, 27 Mar 2012 14:39:57 +0000 (07:39 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 27 Mar 2012 15:18:28 +0000 (08:18 -0700)
Makefile
bin/emerge-webrsync

index 697198ebf6f8207e0eb1e3fe343c4fd38b526660..c49cc669c3fc27c7e228e6909c4cbc0ea70380c9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,8 +29,9 @@ DIRMODE = 0755
 SYSCONFDIR_FILES = etc-update.conf dispatch-conf.conf
 PORTAGE_CONFDIR_FILES = make.globals
 LOGROTATE_FILES = elog-save-summary
-BINDIR_FILES = ebuild egencache emerge portageq quickpkg repoman
-SBINDIR_FILES = archive-conf dispatch-conf emaint emerge-webrsync \
+BINDIR_FILES = ebuild egencache emerge emerge-webrsync \
+       portageq quickpkg repoman
+SBINDIR_FILES = archive-conf dispatch-conf emaint \
        env-update etc-update fixpackages regenworld
 DOCS = ChangeLog NEWS RELEASE-NOTES
 
index e6749f28504668a0bebcf8c70fdfe98593e06e6b..bfd9aa2fc06632556d181fa94c9582e25c44c995 100755 (executable)
@@ -27,11 +27,19 @@ wecho() { echo "${argv0}: warning: $*" 1>&2 ; }
 eecho() { echo "${argv0}: error: $*" 1>&2 ; }
 
 argv0=$0
-if ! type -P portageq > /dev/null ; then
+
+# Use portageq from the same directory/prefix as the current script, so
+# that we don't have to rely on PATH including the current EPREFIX.
+scriptpath=${BASH_SOURCE[0]}
+if [ -x "${scriptpath%/*}/portageq" ]; then
+       portageq=${scriptpath%/*}/portageq
+elif type -P portageq > /dev/null ; then
+       portageq=portageq
+else
        eecho "could not find 'portageq'; aborting"
        exit 1
 fi
-eval $(portageq envvar -v FEATURES FETCHCOMMAND GENTOO_MIRRORS \
+eval $("${portageq}" envvar -v FEATURES FETCHCOMMAND GENTOO_MIRRORS \
        PORTAGE_BIN_PATH PORTAGE_GPG_DIR \
        PORTAGE_NICENESS PORTAGE_RSYNC_EXTRA_OPTS PORTAGE_TMPDIR PORTDIR \
        SYNC http_proxy ftp_proxy)