summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-20 17:31:08 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-20 17:31:08 -0700
commitc32aee053541993a3b7be732798976ed20faba69 (patch)
tree98350a644d566cb2ade3fa5703fadf7719c84bdd
parent5959cb1b25d1d0d7c87fd982df72dfd2212f80a3 (diff)
downloadportage-c32aee053541993a3b7be732798976ed20faba69.tar.gz
portage-c32aee053541993a3b7be732798976ed20faba69.tar.bz2
portage-c32aee053541993a3b7be732798976ed20faba69.zip
At some point we may want to stop exporting FEATURES to the ebuild
environment, in order to prevent ebuilds from abusing it. In preparation for that, export it as PORTAGE_FEATURES so that bashrc users will be able to migrate any FEATURES conditional code to use this alternative variable.
-rwxr-xr-xbin/ebuild.sh2
-rw-r--r--pym/portage/package/ebuild/config.py10
2 files changed, 10 insertions, 2 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 432da6465..de3c80bef 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1711,7 +1711,7 @@ filter_readonly_variables() {
filtered_vars="${filtered_vars} ${filtered_sandbox_vars}"
fi
if hasq --filter-features $* ; then
- filtered_vars="${filtered_vars} FEATURES"
+ filtered_vars="${filtered_vars} FEATURES PORTAGE_FEATURES"
fi
if hasq --filter-path $* ; then
filtered_vars+=" PATH"
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 7d824c47f..51fc0b157 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -233,7 +233,8 @@ class config(object):
"PORTAGE_BIN_PATH",
"PORTAGE_BUILDDIR", "PORTAGE_COLORMAP",
"PORTAGE_CONFIGROOT", "PORTAGE_DEBUG", "PORTAGE_DEPCACHEDIR",
- "PORTAGE_EBUILD_EXIT_FILE", "PORTAGE_GID", "PORTAGE_GRPNAME",
+ "PORTAGE_EBUILD_EXIT_FILE", "PORTAGE_FEATURES",
+ "PORTAGE_GID", "PORTAGE_GRPNAME",
"PORTAGE_INST_GID", "PORTAGE_INST_UID",
"PORTAGE_IPC_DAEMON", "PORTAGE_IUSE",
"PORTAGE_LOG_FILE", "PORTAGE_MASTER_PID",
@@ -2828,6 +2829,13 @@ class config(object):
if v is not None:
mydict[k] = v
+ # At some point we may want to stop exporting FEATURES to the ebuild
+ # environment, in order to prevent ebuilds from abusing it. In
+ # preparation for that, export it as PORTAGE_FEATURES so that bashrc
+ # users will be able to migrate any FEATURES conditional code to
+ # use this alternative variable.
+ mydict["PORTAGE_FEATURES"] = self["FEATURES"]
+
# Filtered by IUSE and implicit IUSE.
mydict["USE"] = self.get("PORTAGE_USE", "")