Fix eread to work on a prefix environment. gentoolkit-0.3.0.6
authorPaul Varner <fuzzyray@gentoo.org>
Wed, 11 Apr 2012 18:50:29 +0000 (13:50 -0500)
committerPaul Varner <fuzzyray@gentoo.org>
Wed, 11 Apr 2012 18:50:29 +0000 (13:50 -0500)
bin/eread

index c6d4de13f5d11afbee0b7de8f71ae8aff246e5f4..7d0a97045006e349d01d35fa202787e22aca4b75 100755 (executable)
--- a/bin/eread
+++ b/bin/eread
@@ -6,13 +6,16 @@
 # Author: Donnie Berkholz <spyderous@gentoo.org>
 # Updated by: Uwe Klosa <uwe.klosa@gmail.com>
 
+# Get prefix
+EPREFIX=${EPREFIX:-$(portageq envvar EPREFIX)}
+
 # set decent PATH for bug 172969
 
-PATH=/usr/bin:/bin:${PATH}
+PATH=${EPREFIX}/usr/bin:${EPREFIX}/bin:${PATH}
 
 # Set ELOGDIR
 PORT_LOGDIR="$(portageq envvar PORT_LOGDIR)"
-[ "$PORT_LOGDIR" = "" ] && PORT_LOGDIR="/var/log/portage"
+[ "$PORT_LOGDIR" = "" ] && PORT_LOGDIR="${EPREFIX}/var/log/portage"
 ELOGDIR="$PORT_LOGDIR/elog"
 
 # Verify that ELOGDIR exists