1 |
Fix pkg_use_display to test if the prefixed flag is in use.force or |
2 |
use.mask, rather than the unprefixed flag. |
3 |
|
4 |
X-Gentoo-bug: 490562 |
5 |
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=490562 |
6 |
--- |
7 |
pym/_emerge/UseFlagDisplay.py | 19 +++++++++++++------ |
8 |
1 file changed, 13 insertions(+), 6 deletions(-) |
9 |
|
10 |
diff --git a/pym/_emerge/UseFlagDisplay.py b/pym/_emerge/UseFlagDisplay.py |
11 |
index f460474..12820e9 100644 |
12 |
--- a/pym/_emerge/UseFlagDisplay.py |
13 |
+++ b/pym/_emerge/UseFlagDisplay.py |
14 |
@@ -3,6 +3,7 @@ |
15 |
|
16 |
from __future__ import unicode_literals |
17 |
|
18 |
+import collections |
19 |
from itertools import chain |
20 |
import sys |
21 |
|
22 |
@@ -60,6 +61,10 @@ class UseFlagDisplay(object): |
23 |
sort_separated = cmp_sort_key(_cmp_separated) |
24 |
del _cmp_separated |
25 |
|
26 |
+ |
27 |
+_flag_info = collections.namedtuple('_flag_info', ('flag', 'display')) |
28 |
+ |
29 |
+ |
30 |
def pkg_use_display(pkg, opts, modified_use=None): |
31 |
settings = pkg.root_config.settings |
32 |
use_expand = pkg.use.expand |
33 |
@@ -81,27 +86,29 @@ def pkg_use_display(pkg, opts, modified_use=None): |
34 |
if f.startswith(flag_prefix): |
35 |
use_expand_flags.add(f) |
36 |
use_enabled.setdefault( |
37 |
- varname.upper(), []).append(f[len(flag_prefix):]) |
38 |
+ varname.upper(), []).append( |
39 |
+ _flag_info(f, f[len(flag_prefix):])) |
40 |
|
41 |
for f in pkg.iuse.all: |
42 |
if f.startswith(flag_prefix): |
43 |
use_expand_flags.add(f) |
44 |
if f not in use: |
45 |
use_disabled.setdefault( |
46 |
- varname.upper(), []).append(f[len(flag_prefix):]) |
47 |
+ varname.upper(), []).append( |
48 |
+ _flag_info(f, f[len(flag_prefix):])) |
49 |
|
50 |
var_order = set(use_enabled) |
51 |
var_order.update(use_disabled) |
52 |
var_order = sorted(var_order) |
53 |
var_order.insert(0, 'USE') |
54 |
use.difference_update(use_expand_flags) |
55 |
- use_enabled['USE'] = list(use) |
56 |
+ use_enabled['USE'] = list(_flag_info(f, f) for f in use) |
57 |
use_disabled['USE'] = [] |
58 |
|
59 |
for f in pkg.iuse.all: |
60 |
if f not in use and \ |
61 |
f not in use_expand_flags: |
62 |
- use_disabled['USE'].append(f) |
63 |
+ use_disabled['USE'].append(_flag_info(f, f)) |
64 |
|
65 |
flag_displays = [] |
66 |
for varname in var_order: |
67 |
@@ -109,9 +116,9 @@ def pkg_use_display(pkg, opts, modified_use=None): |
68 |
continue |
69 |
flags = [] |
70 |
for f in use_enabled.get(varname, []): |
71 |
- flags.append(UseFlagDisplay(f, True, f in forced_flags)) |
72 |
+ flags.append(UseFlagDisplay(f.display, True, f.flag in forced_flags)) |
73 |
for f in use_disabled.get(varname, []): |
74 |
- flags.append(UseFlagDisplay(f, False, f in forced_flags)) |
75 |
+ flags.append(UseFlagDisplay(f.display, False, f.flag in forced_flags)) |
76 |
if alphabetical_use: |
77 |
flags.sort(key=UseFlagDisplay.sort_combined) |
78 |
else: |
79 |
-- |
80 |
2.10.2 |