Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/
Date: Mon, 29 Jul 2019 00:51:51
Message-Id: 1564361423.8eeb4ee67da8ce2143f26f07545e666b3a4ad610.zmedico@gentoo
1 commit: 8eeb4ee67da8ce2143f26f07545e666b3a4ad610
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 29 00:48:07 2019 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 29 00:50:23 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=8eeb4ee6
7
8 filter_flags: handle default IUSE correctly with reduce_flag
9
10 Fix comparisons to use the result of reduce_flag.
11
12 Bug: https://bugs.gentoo.org/690786
13 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
14
15 pym/gentoolkit/flag.py | 19 +++++++++----------
16 1 file changed, 9 insertions(+), 10 deletions(-)
17
18 diff --git a/pym/gentoolkit/flag.py b/pym/gentoolkit/flag.py
19 index 90a931a..42e8196 100644
20 --- a/pym/gentoolkit/flag.py
21 +++ b/pym/gentoolkit/flag.py
22 @@ -116,22 +116,21 @@ def filter_flags(use, use_expand_hidden, usemasked, useforced):
23 """
24 # clean out some environment flags, since they will most probably
25 # be confusing for the user
26 + use = dict((reduce_flag(flag), flag) for flag in use)
27 for f in use_expand_hidden:
28 f=f.lower() + "_"
29 - for x in use:
30 - if f in x:
31 - use.remove(x)
32 + for x in list(use):
33 + if x.startswith(f):
34 + del use[x]
35 # clean out any arch's
36 archlist = portage.settings["PORTAGE_ARCHLIST"].split()
37 - for a in use[:]:
38 - if a in archlist:
39 - use.remove(a)
40 + for a in archlist:
41 + use.pop(a, None)
42 # dbl check if any from usemasked or useforced are still there
43 masked = usemasked + useforced
44 - for a in use[:]:
45 - if a in masked:
46 - use.remove(a)
47 - return use
48 + for a in masked:
49 + use.pop(a, None)
50 + return list(use.values())
51
52
53 def get_all_cpv_use(cpv):