[gentoo-portage-dev] [PATCH] pkg_use_display: show masked/forced state of USE_EXPAND flags (bug 490562)

2017-03-22 Thread Zac Medico
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




Re: [gentoo-portage-dev] [PATCH v2] emerge: fix --usepkg when ebuild is not available (bug 613360)

2017-03-22 Thread Zac Medico
On Tue, Mar 21, 2017 at 4:21 PM, Brian Dolbec  wrote:
> On Mon, 20 Mar 2017 18:22:40 -0700
> Zac Medico  wrote:
>
>> Fix emerge --usepkg to use a binary package when the corresponding
>> ebuild is not available (and --use-ebuild-visibility is not enabled),
>> in cases when no other package is available to satisfy the dependency.
>> This reverts an unintended behavior change from commit
>> e309323f156528a8a79a1f755e1326e8880346b7.
>>
>> Fixes: e309323f1565 ("emerge: fix --use-ebuild-visibility to reject
>> binary packages (bug 612960)") X-Gentoo-bug: 613360
>> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=613360
>> ---
>> [PATCH v2] moves the conditional logic earier, for more backward
>> compatiblity
>>
>>  pym/_emerge/depgraph.py|  3 ++-
>>  .../resolver/test_binary_pkg_ebuild_visibility.py  | 26
>> ++ 2 files changed, 28 insertions(+), 1
>> deletion(-)
>>
>
> looks good

Thanks, merged:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=82bfd91325b052a4c9250a04939641c15b3d2a20
-- 
Thanks,
Zac