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