From c32aee053541993a3b7be732798976ed20faba69 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 20 Aug 2010 17:31:08 -0700 Subject: [PATCH] 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. --- bin/ebuild.sh | 2 +- pym/portage/package/ebuild/config.py | 10 +++++++++- 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", "") -- 2.26.2