summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-18 14:47:41 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-18 14:47:41 +0000
commite3add560fa350b457eda91964d1bdf8fe8e65ecd (patch)
treecdfaf05acf691b33b9ee105e50ff87cdbc05ed04 /pym
parent1260ca830f28cdbee891ebce82f1f0989eabba3e (diff)
downloadportage-e3add560fa350b457eda91964d1bdf8fe8e65ecd.tar.gz
portage-e3add560fa350b457eda91964d1bdf8fe8e65ecd.tar.bz2
portage-e3add560fa350b457eda91964d1bdf8fe8e65ecd.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. svn path=/main/trunk/; revision=8959
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 663d84685..e277fe483 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -971,6 +971,7 @@ class config(object):
self.already_in_regenerate = 0
self._filter_calling_env = False
+ self._environ_use = ""
self.locked = 0
self.mycpv = None
self.puse = []
@@ -997,6 +998,7 @@ class config(object):
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)
@@ -2432,9 +2434,15 @@ class config(object):
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)
@@ -2638,6 +2646,9 @@ class config(object):
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")