summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-12 20:37:49 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-12 20:37:49 +0000
commita359e4cc0bf911f055aec889a7e2e2ead4bc8bc9 (patch)
tree0d36bd40fd9aea21528a466c484a60b36a4cc793 /pym/portage.py
parenta2280b11779985f64af61b3c03075dc648430690 (diff)
downloadportage-a359e4cc0bf911f055aec889a7e2e2ead4bc8bc9.tar.gz
portage-a359e4cc0bf911f055aec889a7e2e2ead4bc8bc9.tar.bz2
portage-a359e4cc0bf911f055aec889a7e2e2ead4bc8bc9.zip
Fix the filtering for bug #215016:
* fix broken comparison for he iuse filtering * filter out any duplicates that variable may contain (trunk r9858) svn path=/main/branches/2.1.2/; revision=9859
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/pym/portage.py b/pym/portage.py
index b4c200bf5..8b0c123e5 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -2106,19 +2106,16 @@ class config:
has_wildcard = "*" in var_split
if has_wildcard:
var_split = [ x for x in var_split if x != "*" ]
- has_iuse = False
+ has_iuse = set()
for x in iuse_implicit:
if x.startswith(prefix):
- has_iuse = True
- break
+ has_iuse.add(x[prefix_len:])
if has_wildcard:
# * means to enable everything in IUSE that's not masked
if has_iuse:
for x in iuse_implicit:
if x.startswith(prefix) and x not in self.usemask:
suffix = x[prefix_len:]
- if suffix in var_split:
- continue
var_split.append(suffix)
use.add(x)
else:
@@ -2126,7 +2123,17 @@ class config:
# LINGUAS should be unset so that all .mo files are
# installed.
var_split = []
- var_split = [x for x in var_split if x in iuse_implicit]
+ # Make the flags unique and filter them according to IUSE.
+ # Also, continue to preserve order for things like LINGUAS
+ # and filter any duplicates that variable may contain.
+ filtered_var_split = []
+ remaining = has_iuse.intersection(var_split)
+ for x in var_split:
+ if x in remaining:
+ remaining.remove(x)
+ filtered_var_split.append(x)
+ var_split = filtered_var_split
+
if var_split:
self[var] = " ".join(var_split)
else: