commit: beb317e71c2d88e20c4dd95217737274d00c145e
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 5 20:12:50 2018 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Nov 5 22:09:08 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=beb317e7
isolated-functions.sh: Do not define any aliases.
save_IFS and restore_IFS are the only aliases that Portage defines,
and they are used exactly once. Rewrite __source_all_bashrcs() not to
depend on them, and remove their definitions.
The intention is to drop the expand_aliases shell option at some time
in the future.
Acked-by: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
bin/ebuild.sh | 8 ++------
bin/isolated-functions.sh | 2 --
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 5491c4f58..00524d019 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -421,13 +421,9 @@ __source_all_bashrcs() {
if [[ $EBUILD_PHASE != depend ]] ; then
# source the existing profile.bashrcs.
- save_IFS
- IFS=$'\n'
- local bashenv_files=($PORTAGE_BASHRC_FILES)
- restore_IFS
- for x in "${bashenv_files[@]}" ; do
+ while read -r x; do
__try_source "${x}"
- done
+ done <<<"${PORTAGE_BASHRC_FILES}"
fi
# The user's bashrc is the ONLY non-portage bit of code
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 39b0ad344..22a6dbb0f 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -11,8 +11,6 @@ fi
# We need this next line for "die" and "assert". It expands
# It _must_ preceed all the calls to die and assert.
shopt -s expand_aliases
-alias save_IFS='[ "${IFS:-unset}" != "unset" ] && old_IFS="${IFS}"'
-alias restore_IFS='if [ "${old_IFS:-unset}" != "unset" ]; then
IFS="${old_IFS}"; unset old_IFS; else unset IFS; fi'
assert() {
local x pipestatus=${PIPESTATUS[*]}