summaryrefslogtreecommitdiffstats
path: root/bin/phase-functions.sh
diff options
context:
space:
mode:
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}