summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2019-07-28 17:48:07 -0700
committerZac Medico <zmedico@gentoo.org>2019-07-28 17:50:23 -0700
commit8eeb4ee67da8ce2143f26f07545e666b3a4ad610 (patch)
tree47fe91f7fdcc011d162a02c948a3428caca61a2e
parentv0.4.5 (diff)
downloadgentoolkit-8eeb4ee67da8ce2143f26f07545e666b3a4ad610.tar.gz
gentoolkit-8eeb4ee67da8ce2143f26f07545e666b3a4ad610.tar.bz2
gentoolkit-8eeb4ee67da8ce2143f26f07545e666b3a4ad610.zip
filter_flags: handle default IUSE correctly with reduce_flag
Fix comparisons to use the result of reduce_flag. Bug: https://bugs.gentoo.org/690786 Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--pym/gentoolkit/flag.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/pym/gentoolkit/flag.py b/pym/gentoolkit/flag.py
index 90a931a..42e8196 100644
--- a/pym/gentoolkit/flag.py
+++ b/pym/gentoolkit/flag.py
@@ -116,22 +116,21 @@ def filter_flags(use, use_expand_hidden, usemasked, useforced):
"""
# clean out some environment flags, since they will most probably
# be confusing for the user
+ use = dict((reduce_flag(flag), flag) for flag in use)
for f in use_expand_hidden:
f=f.lower() + "_"
- for x in use:
- if f in x:
- use.remove(x)
+ for x in list(use):
+ if x.startswith(f):
+ del use[x]
# clean out any arch's
archlist = portage.settings["PORTAGE_ARCHLIST"].split()
- for a in use[:]:
- if a in archlist:
- use.remove(a)
+ for a in archlist:
+ use.pop(a, None)
# dbl check if any from usemasked or useforced are still there
masked = usemasked + useforced
- for a in use[:]:
- if a in masked:
- use.remove(a)
- return use
+ for a in masked:
+ use.pop(a, None)
+ return list(use.values())
def get_all_cpv_use(cpv):