summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-08-03 06:30:05 +0000
committerZac Medico <zmedico@gentoo.org>2006-08-03 06:30:05 +0000
commit67e1a4c0f734a8feb0973fda3564370bff4cd6ea (patch)
tree3263e5a772880f16d11a77459cc3754ed1cb8d67 /pym
parent656ccc792ac634338e92a6ff620292311029f4d5 (diff)
downloadportage-67e1a4c0f734a8feb0973fda3564370bff4cd6ea.tar.gz
portage-67e1a4c0f734a8feb0973fda3564370bff4cd6ea.tar.bz2
portage-67e1a4c0f734a8feb0973fda3564370bff4cd6ea.zip
Expand USE_EXPAND flags earlier so that their incremental stacking behaves just like it does for normal USE flags. See bug #142125.
svn path=/main/trunk/; revision=4112
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py33
1 files changed, 23 insertions, 10 deletions
diff --git a/pym/portage.py b/pym/portage.py
index feb431dab..2a0f60c99 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1421,14 +1421,20 @@ class config:
myincrementals=["USE"]
else:
myincrementals = self.incrementals
-
+ myincrementals = set(myincrementals)
# If self.features exists, it has already been stacked and may have
# been mutated, so don't stack it again or else any mutations will be
# reverted.
if "FEATURES" in myincrementals and hasattr(self, "features"):
- myincrementals = set(myincrementals)
myincrementals.remove("FEATURES")
+ if "USE" in myincrementals:
+ # Process USE last because it depends on USE_EXPAND which is also
+ # an incremental!
+ myincrementals.remove("USE")
+ myincrementals = list(myincrementals)
+ myincrementals.append("USE")
+
for mykey in myincrementals:
if mykey=="USE":
if not self.uvlist:
@@ -1443,6 +1449,7 @@ class config:
use_cache=use_cache, mysettings=self)
else:
self.configdict["auto"]["USE"]=""
+ use_expand = self.get("USE_EXPAND", "").split()
else:
mydbs=self.configlist[:-1]
@@ -1453,6 +1460,20 @@ class config:
#variables are already expanded
mysplit=curdb[mykey].split()
+ if mykey == "USE":
+ for var in use_expand:
+ if var in curdb:
+ var_lower = var.lower()
+ for x in curdb[var].split():
+ if x[0] == "+":
+ x = x[1:]
+ if x[0] == "-":
+ mystr = "-" + var_lower + "_" + x[1:]
+ else:
+ mystr = var_lower + "_" + x
+ if mystr not in mysplit:
+ mysplit.append(mystr)
+
for x in mysplit:
if x=="-*":
# "-*" is a special "minus" var that means "unset all settings".
@@ -1487,14 +1508,6 @@ class config:
if x not in self.usemask:
usesplit.append(x)
- if self.has_key("USE_EXPAND"):
- for var in string.split(self["USE_EXPAND"]):
- if self.has_key(var):
- for x in string.split(self[var]):
- mystr = string.lower(var)+"_"+x
- if mystr not in usesplit and mystr not in self.usemask:
- usesplit.append(mystr)
-
# Pre-Pend ARCH variable to USE settings so '-*' in env doesn't kill arch.
if self.configdict["defaults"].has_key("ARCH"):
if self.configdict["defaults"]["ARCH"]: