summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-05-25 22:13:15 +0000
committerZac Medico <zmedico@gentoo.org>2007-05-25 22:13:15 +0000
commitbd8a17dadba1f7d148ac2d36acca4e327a1420c5 (patch)
tree96c9276dcb72f76091690c8567aa5c91fbbfa60e
parentdef107e4d48042d3acd5ed48a714b23465cde514 (diff)
downloadportage-bd8a17dadba1f7d148ac2d36acca4e327a1420c5.tar.gz
portage-bd8a17dadba1f7d148ac2d36acca4e327a1420c5.tar.bz2
portage-bd8a17dadba1f7d148ac2d36acca4e327a1420c5.zip
Store flags as a set inside the USE incremental loop.
svn path=/main/trunk/; revision=6627
-rw-r--r--pym/portage/__init__.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 813b4f27f..6d28405d4 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1942,7 +1942,7 @@ class config:
self.uvlist.append(self.configdict[x])
self.uvlist.reverse()
- myflags = []
+ myflags = set()
for curdb in self.uvlist:
cur_use_expand = [x for x in use_expand if x in curdb]
mysplit = curdb.get("USE", "").split()
@@ -1950,7 +1950,7 @@ class config:
continue
for x in mysplit:
if x == "-*":
- myflags = []
+ myflags.clear()
continue
if x[0] == "+":
@@ -1961,19 +1961,18 @@ class config:
continue
if x[0] == "-":
- try:
- myflags.remove(x[1:])
- except ValueError:
- pass
+ myflags.discard(x[1:])
continue
- myflags.append(x)
+ myflags.add(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 list(myflags):
+ if x.startswith(prefix):
+ myflags.remove(x)
for x in curdb[var].split():
# Any incremental USE_EXPAND variables have already been
# processed, so leading +/- operators are invalid here.
@@ -1987,9 +1986,8 @@ class config:
"non-incremental variable '%s': '%s'\n" % (var, x)),
noiselevel=-1)
continue
- myflags.append(var_lower + "_" + x)
+ myflags.add(var_lower + "_" + x)
- myflags = set(myflags)
myflags.update(self.useforce)
# FEATURES=test should imply USE=test