summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-05-25 19:14:11 +0000
committerZac Medico <zmedico@gentoo.org>2007-05-25 19:14:11 +0000
commitc48ae7ac7c7f6c8d3cb0f21253e8bb66ef8678bb (patch)
tree21491f7c565a282ba7d128e1c3d3fb1992ed0bde /pym
parent0672c5b1bcde3b7f174d97da328ba1601bb35c0b (diff)
downloadportage-c48ae7ac7c7f6c8d3cb0f21253e8bb66ef8678bb.tar.gz
portage-c48ae7ac7c7f6c8d3cb0f21253e8bb66ef8678bb.tar.bz2
portage-c48ae7ac7c7f6c8d3cb0f21253e8bb66ef8678bb.zip
For bug #179766, expand USE_EXPAND variables inside the USE incremental loop so that USE"-*" will not always destroy them.
svn path=/main/trunk/; revision=6623
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py49
1 files changed, 25 insertions, 24 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 191d6d070..bc48de8a1 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1934,26 +1934,7 @@ class config:
else:
self.configdict["auto"]["USE"] = ""
- use_expand_protected = []
use_expand = self.get("USE_EXPAND", "").split()
- for var in use_expand:
- var_lower = var.lower()
- for x in self.get(var, "").split():
- # Any incremental USE_EXPAND variables have already been
- # processed, so leading +/- operators are invalid here.
- if x[0] == "+":
- writemsg(colorize("BAD", "Invalid '+' operator in " + \
- "non-incremental variable '%s': '%s'\n" % (var, x)),
- noiselevel=-1)
- x = x[1:]
- if x[0] == "-":
- writemsg(colorize("BAD", "Invalid '-' operator in " + \
- "non-incremental variable '%s': '%s'\n" % (var, x)),
- noiselevel=-1)
- continue
- mystr = var_lower + "_" + x
- if mystr not in use_expand_protected:
- use_expand_protected.append(mystr)
if not self.uvlist:
for x in self["USE_ORDER"].split(":"):
@@ -1961,11 +1942,12 @@ class config:
self.uvlist.append(self.configdict[x])
self.uvlist.reverse()
- myflags = use_expand_protected[:]
+ myflags = []
for curdb in self.uvlist:
- if "USE" not in curdb:
+ cur_use_expand = [x for x in use_expand if x in curdb]
+ mysplit = curdb.get("USE", "").split()
+ if not mysplit and not cur_use_expand:
continue
- mysplit = curdb["USE"].split()
for x in mysplit:
if x == "-*":
myflags = []
@@ -1985,8 +1967,27 @@ class config:
pass
continue
- if x not in myflags:
- myflags.append(x)
+ myflags.append(x)
+
+ for var in cur_use_expand:
+ var_lower = var.lower()
+ if var not in myincrementals:
+ prefix = var_lower + "_"
+ myflags = [x for x in myflags if not x.startswith(prefix)]
+ for x in curdb[var].split():
+ # Any incremental USE_EXPAND variables have already been
+ # processed, so leading +/- operators are invalid here.
+ if x[0] == "+":
+ writemsg(colorize("BAD", "Invalid '+' operator in " + \
+ "non-incremental variable '%s': '%s'\n" % (var, x)),
+ noiselevel=-1)
+ x = x[1:]
+ if x[0] == "-":
+ writemsg(colorize("BAD", "Invalid '-' operator in " + \
+ "non-incremental variable '%s': '%s'\n" % (var, x)),
+ noiselevel=-1)
+ continue
+ myflags.append(var_lower + "_" + x)
myflags = set(myflags)
myflags.update(self.useforce)