summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-12-17 03:21:33 +0000
committerZac Medico <zmedico@gentoo.org>2009-12-17 03:21:33 +0000
commitc77cb15188ad39e2eb2ba87fdda0dfd92d643b82 (patch)
tree47b6bb900e52542911adec9d15776453323199da
parente8d3ff5b67fa45fbd71e288684e600da919f5d8f (diff)
downloadportage-c77cb15188ad39e2eb2ba87fdda0dfd92d643b82.tar.gz
portage-c77cb15188ad39e2eb2ba87fdda0dfd92d643b82.tar.bz2
portage-c77cb15188ad39e2eb2ba87fdda0dfd92d643b82.zip
Bug #296870 - Allow locale related LANG and LC_* variables to persist between
ebuild phases, and only filter them for binary and installed packages. (trunk r15096) svn path=/main/branches/2.1.7/; revision=15101
-rwxr-xr-xbin/ebuild.sh13
-rwxr-xr-xbin/isolated-functions.sh5
2 files changed, 12 insertions, 6 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 62d051eea..9ae2eecbc 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1638,6 +1638,12 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
# phase. However, if FEATURES exist inside environment.bz2 then they
# should be overridden by current settings.
#
+# --filter-locale causes locale related variables such as LANG and LC_*
+# variables to be filtered. These variables should persist between phases,
+# in case they are modified by the ebuild. However, the current user
+# settings should be used when loading the environment from a binary or
+# installed package.
+#
# ---allow-extra-vars causes some extra vars to be allowd through, such
# as ${PORTAGE_SAVED_READONLY_VARS} and ${PORTAGE_MUTABLE_FILTERED_VARS}.
#
@@ -1677,6 +1683,11 @@ filter_readonly_variables() {
if hasq --filter-features $* ; then
filtered_vars="${filtered_vars} FEATURES"
fi
+ if hasq --filter-locale $* ; then
+ filtered_vars+=" LANG LC_ALL LC_COLLATE
+ LC_CTYPE LC_MESSAGES LC_MONETARY
+ LC_NUMERIC LC_PAPER LC_TIME"
+ fi
if ! hasq --allow-extra-vars $* ; then
filtered_vars="
${filtered_vars}
@@ -1702,7 +1713,7 @@ preprocess_ebuild_env() {
# environment may contain stale SANDBOX_{DENY,PREDICT,READ,WRITE}
# and FEATURES variables that should be filtered out. Between
# phases, these variables are normally preserved.
- filter_opts="--filter-sandbox --filter-features ${filter_opts}"
+ filter_opts+=" --filter-sandbox --filter-features --filter-locale"
fi
filter_readonly_variables ${filter_opts} < "${T}"/environment \
> "${T}"/environment.filtered || return $?
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 294324889..893ce57ba 100755
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -506,11 +506,6 @@ save_ebuild_env() {
unset ECHANGELOG_USER GPG_AGENT_INFO \
SSH_AGENT_PID SSH_AUTH_SOCK STY WINDOW XAUTHORITY
- # localization settings
- unset LANG LC_COLLATE LC_CTYPE LC_MESSAGES \
- LC_MONETARY LC_NUMERIC LC_TIME LC_PAPER \
- LC_ALL
-
# CCACHE and DISTCC config
unset ${!CCACHE_*} ${!DISTCC_*}