From 8eeb4ee67da8ce2143f26f07545e666b3a4ad610 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 28 Jul 2019 17:48:07 -0700 Subject: 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 --- pym/gentoolkit/flag.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'pym/gentoolkit/flag.py') 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): -- cgit v1.2.3-65-gdbad