summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-13 10:30:38 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-13 10:30:38 +0000
commitb157c80015e9748e86e6324ce875e69dd21b3392 (patch)
tree23998584b90591457cd69f4cb6cd5171324f9d5c
parent14b227f12b0552f5b96a2cdbb814dec30d576be5 (diff)
downloadportage-b157c80015e9748e86e6324ce875e69dd21b3392.tar.gz
portage-b157c80015e9748e86e6324ce875e69dd21b3392.tar.bz2
portage-b157c80015e9748e86e6324ce875e69dd21b3392.zip
Allow FEATURES to persist between phases since the user might
want to modify it via bashrc to enable things like splitdebug and installsources for specific packages. They should be able to modify it in pre_pkg_setup() and have it persist all the way through the install phase. However, if FEATURES exist inside environment.bz2 then they should be overridden by current settings. svn path=/main/trunk/; revision=8909
-rwxr-xr-xbin/ebuild.sh17
-rwxr-xr-xbin/isolated-functions.sh2
2 files changed, 15 insertions, 4 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1823691e0..25638be66 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1387,6 +1387,14 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
# is only desired in certain cases, such as during preprocessing or when
# saving environment.bz2 for a binary or installed package.
#
+# --filter-features causes the special FEATURES variable to be filtered.
+# Generally, we want it to persist between phases since the user might
+# want to modify it via bashrc to enable things like splitdebug and
+# installsources for specific packages. They should be able to modify it
+# in pre_pkg_setup() and have it persist all the way through the install
+# phase. However, if FEATURES exist inside environment.bz2 then they
+# should be overridden by current settings.
+#
# ---allow-extra-vars causes some extra vars to be allowd through, such
# as ${PORTAGE_SAVED_READONLY_VARS} and ${PORTAGE_MUTABLE_FILTERED_VARS}.
#
@@ -1408,6 +1416,9 @@ filter_readonly_variables() {
else
filtered_vars="${filtered_vars} ${filtered_sandbox_vars}"
fi
+ if hasq --filter-features $* ; then
+ filtered_vars="${filtered_vars} FEATURES"
+ fi
if ! hasq --allow-extra-vars $* ; then
filtered_vars="
${filtered_vars}
@@ -1443,9 +1454,9 @@ preprocess_ebuild_env() {
if [ -f "${T}/environment.raw" ] ; then
# This is a signal from the python side, indicating that the
# environment may contain stale SANDBOX_{DENY,PREDICT,READ,WRITE}
- # variables that should be filtered out. Between phases, these
- # variables are normally preserved.
- filter_opts="--filter-sandbox ${filter_opts}"
+ # and FEATURES variables that should be filtered out. Between
+ # phases, these variables are normally preserved.
+ filter_opts="--filter-sandbox --filter-features ${filter_opts}"
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 dfe4cfba7..20bcccf9b 100755
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -435,7 +435,7 @@ save_ebuild_env() {
unset BAD BRACKET BUILD_PREFIX COLS \
DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \
EBUILD_EXIT_STATUS_FILE EBUILD_MASTER_PID \
- ECLASSDIR ECLASS_DEPTH ENDCOL FAKEROOTKEY FEATURES \
+ ECLASSDIR ECLASS_DEPTH ENDCOL FAKEROOTKEY \
GOOD HILITE HOME IMAGE \
LAST_E_CMD LAST_E_LEN LD_PRELOAD MISC_FUNCTIONS_ARGS MOPREFIX \
NORMAL PATH PKGDIR PKGUSE PKG_LOGDIR PKG_TMPDIR \