summaryrefslogtreecommitdiffstats
path: root/bin/phase-functions.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-12-21 20:06:36 -0800
committerZac Medico <zmedico@gentoo.org>2011-12-21 20:06:36 -0800
commit7ae2254d1e8db0e3976b82c65a8640cfc99cedb1 (patch)
tree8cd2115b9bc21dc7f87fc8bbd5f10a838a4f59dd /bin/phase-functions.sh
parent0cb2523bca051aa06e73169d647d2ad3278fa25f (diff)
downloadportage-7ae2254d1e8db0e3976b82c65a8640cfc99cedb1.tar.gz
portage-7ae2254d1e8db0e3976b82c65a8640cfc99cedb1.tar.bz2
portage-7ae2254d1e8db0e3976b82c65a8640cfc99cedb1.zip
filter_readonly_variables: preserve binpkg vars
Diffstat (limited to 'bin/phase-functions.sh')
-rw-r--r--bin/phase-functions.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 26ffde6b4..482fd6ac2 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -74,6 +74,8 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
#
# ---allow-extra-vars causes some extra vars to be allowd through, such
# as ${PORTAGE_SAVED_READONLY_VARS} and ${PORTAGE_MUTABLE_FILTERED_VARS}.
+# This is enabled automatically if EMERGE_FROM=binary, since it preserves
+# variables from when the package was originally built.
#
# In bash-3.2_p20+ an attempt to assign BASH_*, FUNCNAME, GROUPS or any
# readonly variable cause the shell to exit while executing the "source"
@@ -122,7 +124,7 @@ filter_readonly_variables() {
LC_CTYPE LC_MESSAGES LC_MONETARY
LC_NUMERIC LC_PAPER LC_TIME"
fi
- if ! has --allow-extra-vars $* ; then
+ if [[ ${EMERGE_FROM} != binary ]] && ! has --allow-extra-vars $* ; then
filtered_vars="
${filtered_vars}
${PORTAGE_SAVED_READONLY_VARS}