aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-21 00:30:22 +0000
committerRoy Marples <roy@marples.name>2008-03-21 00:30:22 +0000
commite47661449a7fe3c52ff0b5766bfa54699e1030bd (patch)
treef936d0160b26bc01a8dfd98e0f437861e07ff329
parent04b0acb0106acf4fadd51b8dce1fcd3ea736ce6f (diff)
More pathing fixes.
-rw-r--r--sh/functions.sh.in10
1 files changed, 8 insertions, 2 deletions
diff --git a/sh/functions.sh.in b/sh/functions.sh.in
index 1a71fbd3..c0b05c7e 100644
--- a/sh/functions.sh.in
+++ b/sh/functions.sh.in
@@ -66,7 +66,13 @@ _PREFIX=@PREFIX@
_PKG_PREFIX=@PKG_PREFIX@
_LOCAL_PREFIX=@LOCAL_PREFIX@
_LOCAL_PREFIX=${_LOCAL_PREFIX:-/usr/local}
-_PATH=@PREFIX@/lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin
+_PATH=@PREFIX@/lib/rc/bin
+case "${_PREFIX}" in
+ "${_PKG_PREFIX}"|"${_LOCAL_PREFIX}") ;;
+ *) _PATH="${_PATH}:${_PREFIX}/bin:${_PREFIX}/sbin";;
+esac
+_PATH="${_PATH}":/bin:/sbin:/usr/bin:/usr/sbin
+
if [ -n "${_PKG_PREFIX}" ]; then
_PATH="${_PATH}:${_PKG_PREFIX}/bin:${_PKG_PREFIX}/sbin"
fi
@@ -93,7 +99,7 @@ else
# the last ecmd
for _e in ebegin eend error errorn einfo einfon ewarn ewarnn ewend \
vebegin veend veinfo vewarn vewend; do
- eval "${_e}() { local _r; /lib/rc/bin/${_e} \"\$@\"; _r=$?; \
+ eval "${_e}() { local _r; @PREFIX@/lib/rc/bin/${_e} \"\$@\"; _r=$?; \
export EINFO_LASTCMD=${_e}; return \$_r; }"
done
fi