summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-18 14:49:00 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-18 14:49:00 +0000
commit9869b80cb4479a2b4d0e5c46b6f8dd429492225f (patch)
tree38124acd2b56ff06e462d265d9d8640425322eaf
parent956087e60012f1b8224559422ff63f3acef869db (diff)
downloadportage-9869b80cb4479a2b4d0e5c46b6f8dd429492225f.tar.gz
portage-9869b80cb4479a2b4d0e5c46b6f8dd429492225f.tar.bz2
portage-9869b80cb4479a2b4d0e5c46b6f8dd429492225f.zip
Store filtered USE for config.environ() calls in a special
attribute so that the normal global USE is still available for things like emerge --info output. (trunk r8959) svn path=/main/branches/2.1.2/; revision=8960
-rw-r--r--pym/portage.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 8a3426b34..fd678f7df 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1106,6 +1106,7 @@ class config:
self.already_in_regenerate = 0
self._filter_calling_env = False
+ self._environ_use = ""
self.locked = 0
self.mycpv = None
self.puse = []
@@ -1133,6 +1134,7 @@ class config:
if clone:
self._filter_calling_env = copy.deepcopy(clone._filter_calling_env)
+ self._environ_use = copy.deepcopy(clone._environ_use)
self.incrementals = copy.deepcopy(clone.incrementals)
self.profile_path = copy.deepcopy(clone.profile_path)
self.user_profile_dir = copy.deepcopy(clone.user_profile_dir)
@@ -2413,9 +2415,15 @@ class config:
iuse_grep = ""
self["PORTAGE_IUSE"] = iuse_grep
- usesplit = [x for x in usesplit if \
- x in iuse_implicit and \
- x not in self.usemask]
+ usesplit = [x for x in usesplit if \
+ x not in self.usemask]
+
+ # Filtered for the ebuild environment. Store this in a separate
+ # attribute since we still want to be able to see global USE
+ # settings for things like emerge --info.
+ self._environ_use = " ".join(sorted(
+ x for x in usesplit if \
+ x in iuse_implicit))
usesplit.sort()
self.configlist[-1]["USE"]= " ".join(usesplit)
@@ -2619,6 +2627,9 @@ class config:
if v is not None:
mydict[k] = v
+ # Filtered be IUSE / implicit IUSE.
+ mydict["USE"] = self._environ_use
+
# sandbox's bashrc sources /etc/profile which unsets ROOTPATH,
# so we have to back it up and restore it.
rootpath = mydict.get("ROOTPATH")