From 67e1a4c0f734a8feb0973fda3564370bff4cd6ea Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 3 Aug 2006 06:30:05 +0000 Subject: 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 --- pym/portage.py | 33 +++++++++++++++++++++++---------- 1 file 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"]: -- cgit v1.2.3-1-g7c22