diff options
-rw-r--r-- | pym/portage.py | 33 |
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"]: |