1 |
Bug: https://bugs.gentoo.org/636596 |
2 |
--- |
3 |
pym/portage/dep/__init__.py | 3 +++ |
4 |
pym/portage/tests/resolver/test_eapi.py | 9 ++++++++- |
5 |
2 files changed, 11 insertions(+), 1 deletion(-) |
6 |
|
7 |
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py |
8 |
index 2a081f3d8..47ec7a6c1 100644 |
9 |
--- a/pym/portage/dep/__init__.py |
10 |
+++ b/pym/portage/dep/__init__.py |
11 |
@@ -562,6 +562,9 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i |
12 |
basestring): |
13 |
if stack[level][-1] == "||" and not l: |
14 |
#Optimize: || ( ) -> . |
15 |
+ if not eapi_attrs.empty_groups_always_true: |
16 |
+ # in EAPI 7+, we need to fail here |
17 |
+ l.append(token_class("__const__/empty-any-of")) |
18 |
stack[level].pop() |
19 |
elif stack[level][-1][-1] == "?": |
20 |
#The last token before the '(' that matches the current ')' |
21 |
diff --git a/pym/portage/tests/resolver/test_eapi.py b/pym/portage/tests/resolver/test_eapi.py |
22 |
index 525b58532..fce05890b 100644 |
23 |
--- a/pym/portage/tests/resolver/test_eapi.py |
24 |
+++ b/pym/portage/tests/resolver/test_eapi.py |
25 |
@@ -1,4 +1,4 @@ |
26 |
-# Copyright 2010 Gentoo Foundation |
27 |
+# Copyright 2010-2018 Gentoo Foundation |
28 |
# Distributed under the terms of the GNU General Public License v2 |
29 |
|
30 |
from portage.tests import TestCase |
31 |
@@ -59,6 +59,10 @@ class EAPITestCase(TestCase): |
32 |
"dev-libs/A-7.4": { "EAPI": "4", "IUSE": "foo +bar", "REQUIRED_USE": "|| ( foo bar )" }, |
33 |
|
34 |
"dev-libs/B-1": {"EAPI": 1, "IUSE": "+foo"}, |
35 |
+ |
36 |
+ #EAPI-7: implicit || ( ) no longer satisfies deps |
37 |
+ "dev-libs/C-1": { "EAPI": "6", "IUSE": "foo", "RDEPEND": "|| ( foo? ( dev-libs/B ) )" }, |
38 |
+ "dev-libs/C-2": { "EAPI": "7_pre1", "IUSE": "foo", "RDEPEND": "|| ( foo? ( dev-libs/B ) )" }, |
39 |
} |
40 |
|
41 |
test_cases = ( |
42 |
@@ -104,6 +108,9 @@ class EAPITestCase(TestCase): |
43 |
ResolverPlaygroundTestCase(["=dev-libs/A-7.2"], success = False), |
44 |
ResolverPlaygroundTestCase(["=dev-libs/A-7.3"], success = False), |
45 |
ResolverPlaygroundTestCase(["=dev-libs/A-7.4"], success = True, mergelist = ["dev-libs/A-7.4"]), |
46 |
+ |
47 |
+ ResolverPlaygroundTestCase(["=dev-libs/C-1"], success = True, mergelist = ["dev-libs/C-1"]), |
48 |
+ ResolverPlaygroundTestCase(["=dev-libs/C-2"], success = False), |
49 |
) |
50 |
|
51 |
playground = ResolverPlayground(ebuilds=ebuilds) |
52 |
-- |
53 |
2.16.2 |