Re: [gentoo-portage-dev] [PATCH] pkg_use_display: show masked/forced state of USE_EXPAND flags (bug 490562)
On Fri, Mar 31, 2017 at 1:05 PM, Brian Dolbecwrote: > On Wed, 22 Mar 2017 09:32:36 -0700 > Zac Medico wrote: > >> Fix pkg_use_display to test if the prefixed flag is in use.force or >> use.mask, rather than the unprefixed flag. >> >> X-Gentoo-bug: 490562 >> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=490562 > > Sorry, Zac, I somehow missed this one... too busy with my head burried > in twisted test fixes and new deps... > > Looks fine :) Thanks, pushed: https://gitweb.gentoo.org/proj/portage.git/commit/?id=09ee3124256c2bb0785e246533b62d310d54082e -- Thanks, Zac
Re: [gentoo-portage-dev] [PATCH] pkg_use_display: show masked/forced state of USE_EXPAND flags (bug 490562)
On Wed, 22 Mar 2017 09:32:36 -0700 Zac Medicowrote: > Fix pkg_use_display to test if the prefixed flag is in use.force or > use.mask, rather than the unprefixed flag. > > X-Gentoo-bug: 490562 > X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=490562 > --- > pym/_emerge/UseFlagDisplay.py | 19 +-- > 1 file changed, 13 insertions(+), 6 deletions(-) > > diff --git a/pym/_emerge/UseFlagDisplay.py > b/pym/_emerge/UseFlagDisplay.py index f460474..12820e9 100644 > --- a/pym/_emerge/UseFlagDisplay.py > +++ b/pym/_emerge/UseFlagDisplay.py > @@ -3,6 +3,7 @@ > > from __future__ import unicode_literals > > +import collections > from itertools import chain > import sys > > @@ -60,6 +61,10 @@ class UseFlagDisplay(object): > sort_separated = cmp_sort_key(_cmp_separated) > del _cmp_separated > > + > +_flag_info = collections.namedtuple('_flag_info', ('flag', > 'display')) + > + > def pkg_use_display(pkg, opts, modified_use=None): > settings = pkg.root_config.settings > use_expand = pkg.use.expand > @@ -81,27 +86,29 @@ def pkg_use_display(pkg, opts, modified_use=None): > if f.startswith(flag_prefix): > use_expand_flags.add(f) > use_enabled.setdefault( > - varname.upper(), > []).append(f[len(flag_prefix):]) > + varname.upper(), []).append( > + _flag_info(f, > f[len(flag_prefix):])) > for f in pkg.iuse.all: > if f.startswith(flag_prefix): > use_expand_flags.add(f) > if f not in use: > use_disabled.setdefault( > - varname.upper(), > []).append(f[len(flag_prefix):]) > + varname.upper(), > []).append( > + > _flag_info(f, f[len(flag_prefix):])) > var_order = set(use_enabled) > var_order.update(use_disabled) > var_order = sorted(var_order) > var_order.insert(0, 'USE') > use.difference_update(use_expand_flags) > - use_enabled['USE'] = list(use) > + use_enabled['USE'] = list(_flag_info(f, f) for f in use) > use_disabled['USE'] = [] > > for f in pkg.iuse.all: > if f not in use and \ > f not in use_expand_flags: > - use_disabled['USE'].append(f) > + use_disabled['USE'].append(_flag_info(f, f)) > > flag_displays = [] > for varname in var_order: > @@ -109,9 +116,9 @@ def pkg_use_display(pkg, opts, modified_use=None): > continue > flags = [] > for f in use_enabled.get(varname, []): > - flags.append(UseFlagDisplay(f, True, f in > forced_flags)) > + flags.append(UseFlagDisplay(f.display, True, > f.flag in forced_flags)) for f in use_disabled.get(varname, []): > - flags.append(UseFlagDisplay(f, False, f in > forced_flags)) > + flags.append(UseFlagDisplay(f.display, > False, f.flag in forced_flags)) if alphabetical_use: > flags.sort(key=UseFlagDisplay.sort_combined) > else: Sorry, Zac, I somehow missed this one... too busy with my head burried in twisted test fixes and new deps... Looks fine :) -- Brian Dolbec
[gentoo-portage-dev] [PATCH] pkg_use_display: show masked/forced state of USE_EXPAND flags (bug 490562)
Fix pkg_use_display to test if the prefixed flag is in use.force or use.mask, rather than the unprefixed flag. X-Gentoo-bug: 490562 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=490562 --- pym/_emerge/UseFlagDisplay.py | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pym/_emerge/UseFlagDisplay.py b/pym/_emerge/UseFlagDisplay.py index f460474..12820e9 100644 --- a/pym/_emerge/UseFlagDisplay.py +++ b/pym/_emerge/UseFlagDisplay.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals +import collections from itertools import chain import sys @@ -60,6 +61,10 @@ class UseFlagDisplay(object): sort_separated = cmp_sort_key(_cmp_separated) del _cmp_separated + +_flag_info = collections.namedtuple('_flag_info', ('flag', 'display')) + + def pkg_use_display(pkg, opts, modified_use=None): settings = pkg.root_config.settings use_expand = pkg.use.expand @@ -81,27 +86,29 @@ def pkg_use_display(pkg, opts, modified_use=None): if f.startswith(flag_prefix): use_expand_flags.add(f) use_enabled.setdefault( - varname.upper(), []).append(f[len(flag_prefix):]) + varname.upper(), []).append( + _flag_info(f, f[len(flag_prefix):])) for f in pkg.iuse.all: if f.startswith(flag_prefix): use_expand_flags.add(f) if f not in use: use_disabled.setdefault( - varname.upper(), []).append(f[len(flag_prefix):]) + varname.upper(), []).append( + _flag_info(f, f[len(flag_prefix):])) var_order = set(use_enabled) var_order.update(use_disabled) var_order = sorted(var_order) var_order.insert(0, 'USE') use.difference_update(use_expand_flags) - use_enabled['USE'] = list(use) + use_enabled['USE'] = list(_flag_info(f, f) for f in use) use_disabled['USE'] = [] for f in pkg.iuse.all: if f not in use and \ f not in use_expand_flags: - use_disabled['USE'].append(f) + use_disabled['USE'].append(_flag_info(f, f)) flag_displays = [] for varname in var_order: @@ -109,9 +116,9 @@ def pkg_use_display(pkg, opts, modified_use=None): continue flags = [] for f in use_enabled.get(varname, []): - flags.append(UseFlagDisplay(f, True, f in forced_flags)) + flags.append(UseFlagDisplay(f.display, True, f.flag in forced_flags)) for f in use_disabled.get(varname, []): - flags.append(UseFlagDisplay(f, False, f in forced_flags)) + flags.append(UseFlagDisplay(f.display, False, f.flag in forced_flags)) if alphabetical_use: flags.sort(key=UseFlagDisplay.sort_combined) else: -- 2.10.2