Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] Support !test? conditionals in RESTRICT (bug 663278)
Date: Sat, 11 Aug 2018 21:14:20
Message-Id: 20180811211154.20548-1-zmedico@gentoo.org
1 Since RESTRICT="!test? ( test )" can be very useful within the context
2 of bug 663278, pass an appropriate uselist parameter to the RESTRICT
3 use_reduce call.
4
5 Bug: https://bugs.gentoo.org/663278
6 ---
7 lib/portage/package/ebuild/config.py | 9 +++------
8 1 file changed, 3 insertions(+), 6 deletions(-)
9
10 diff --git a/lib/portage/package/ebuild/config.py b/lib/portage/package/ebuild/config.py
11 index 220fa31bb..353ee239c 100644
12 --- a/lib/portage/package/ebuild/config.py
13 +++ b/lib/portage/package/ebuild/config.py
14 @@ -1675,13 +1675,10 @@ class config(object):
15 restrict = use_reduce(raw_restrict,
16 uselist=built_use, flat=True)
17 else:
18 - # Use matchnone=True to ignore USE conditional parts
19 - # of RESTRICT, since we want to know whether to mask
20 - # the "test" flag _before_ we know the USE values
21 - # that would be needed to evaluate the USE
22 - # conditionals (see bug #273272).
23 restrict = use_reduce(raw_restrict,
24 - matchnone=True, flat=True)
25 + uselist=frozenset(x for x in self['USE'].split()
26 + if x in explicit_iuse or iuse_implicit_match(x)),
27 + flat=True)
28 except PortageException:
29 pass
30 else:
31 --
32 2.16.4

Replies