aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2012-12-07 22:19:37 -0800
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-12-09 17:34:49 +0000
commit81a487def0c8392e743df3778d99317e297a9b7d (patch)
tree40dd4a715a97c7569b14378bb63ef8c21b77bd80
parentee72aa6793a140b38d7531eb28d2b1b7b43b354d (diff)
downloadpaludis-81a487def0c8392e743df3778d99317e297a9b7d.tar.gz
paludis-81a487def0c8392e743df3778d99317e297a9b7d.tar.xz
ebuild: reorder and uniformise PATH
Make the search PATH order prefer the secondary hierarchy (/usr) as it is the primary point for user binaries. Still permit falling back to the primary binary (user and system) directories in the case an executable is not found in the user supplied path, nor the secondary hierarchy. Make the PATH setup uniform across normal and binary ebuilds as well as during VDB updates.
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash2
-rwxr-xr-xpaludis/repositories/e/ebuild/write_binary_ebuild.bash11
-rwxr-xr-xpaludis/repositories/e/ebuild/write_vdb_entry.bash11
3 files changed, 15 insertions, 9 deletions
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 6a893bc..9683844 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -52,7 +52,7 @@ ebuild_sanitise_envvars()
# Force a few more things into PATH, since some users have crazy setups.
# See ticket:374.
- export PATH="/bin:/sbin:/usr/bin:/usr/sbin${PATH:+:${PATH}}"
+ export PATH="/usr/bin:/usr/sbin:/bin:/sbin${PATH:+:${PATH}}"
# Automake likes to scatter our utilities over two directories.
if [[ -n "${PALUDIS_EBUILD_DIR_FALLBACK}" ]] ; then
diff --git a/paludis/repositories/e/ebuild/write_binary_ebuild.bash b/paludis/repositories/e/ebuild/write_binary_ebuild.bash
index 3188ee7..5b20543 100755
--- a/paludis/repositories/e/ebuild/write_binary_ebuild.bash
+++ b/paludis/repositories/e/ebuild/write_binary_ebuild.bash
@@ -24,6 +24,13 @@ eval unset LANG ${!LC_*}
shopt -s expand_aliases
shopt -s extglob
+# Force a few more things into PATH, since some users have crazy setups.
+# See ticket:374.
+# NOTE(compnerd) this must be done first to ensure that the fallback directory
+# and utils directory take precedence over the path as some of our utilities
+# overload standard commands.
+export PATH="/usr/bin:/usr/sbin:/bin:/sbin${PATH:+:${PATH}}"
+
if [[ -n "${PALUDIS_EBUILD_DIR_FALLBACK}" ]] ; then
export PATH="${PALUDIS_EBUILD_DIR_FALLBACK}/utils:${PATH}"
fi
@@ -32,10 +39,6 @@ for p in ${PALUDIS_UTILITY_PATH_SUFFIXES} ; do
export PATH="${PALUDIS_EBUILD_DIR}/utils/${p}:${PATH}"
done
-# Force a few more things into PATH, since some users have crazy setups.
-# See ticket:374.
-export PATH="${PATH}:/bin:/sbin:/usr/bin:/usr/sbin"
-
EBUILD_MODULES_DIR=$(canonicalise $(dirname $0 ) )
if ! [[ -d ${EBUILD_MODULES_DIR} ]] ; then
echo "${EBUILD_MODULES_DIR} is not a directory" 1>&2
diff --git a/paludis/repositories/e/ebuild/write_vdb_entry.bash b/paludis/repositories/e/ebuild/write_vdb_entry.bash
index 5e78071..0e0abc8 100755
--- a/paludis/repositories/e/ebuild/write_vdb_entry.bash
+++ b/paludis/repositories/e/ebuild/write_vdb_entry.bash
@@ -24,6 +24,13 @@ eval unset LANG ${!LC_*}
shopt -s expand_aliases
shopt -s extglob
+# Force a few more things into PATH, since some users have crazy setups.
+# See ticket:374.
+# NOTE(compnerd) this must be done first to ensure that the fallback directory
+# and utils directory take precedence over the path as some of our utilities
+# overload standard commands.
+export PATH="/usr/bin:/usr/sbin:/bin:/sbin${PATH:+:${PATH}}"
+
if [[ -n "${PALUDIS_EBUILD_DIR_FALLBACK}" ]] ; then
export PATH="${PALUDIS_EBUILD_DIR_FALLBACK}/utils:${PATH}"
fi
@@ -32,10 +39,6 @@ for p in ${PALUDIS_UTILITY_PATH_SUFFIXES} ; do
export PATH="${PALUDIS_EBUILD_DIR}/utils/${p}:${PATH}"
done
-# Force a few more things into PATH, since some users have crazy setups.
-# See ticket:374.
-export PATH="${PATH}:/bin:/sbin:/usr/bin:/usr/sbin"
-
EBUILD_MODULES_DIR=$(canonicalise $(dirname $0 ) )
if ! [[ -d ${EBUILD_MODULES_DIR} ]] ; then
echo "${EBUILD_MODULES_DIR} is not a directory" 1>&2