Bug: https://bugs.gentoo.org/636596 --- pym/portage/dep/__init__.py | 3 +++ pym/portage/tests/resolver/test_eapi.py | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index 2a081f3d8..47ec7a6c1 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -562,6 +562,9 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i basestring): if stack[level][-1] == "||" and not l: #Optimize: || ( ) -> . + if not eapi_attrs.empty_groups_always_true: + # in EAPI 7+, we need to fail here + l.append(token_class("__const__/empty-any-of")) stack[level].pop() elif stack[level][-1][-1] == "?": #The last token before the '(' that matches the current ')' diff --git a/pym/portage/tests/resolver/test_eapi.py b/pym/portage/tests/resolver/test_eapi.py index 525b58532..fce05890b 100644 --- a/pym/portage/tests/resolver/test_eapi.py +++ b/pym/portage/tests/resolver/test_eapi.py @@ -1,4 +1,4 @@ -# Copyright 2010 Gentoo Foundation +# Copyright 2010-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase @@ -59,6 +59,10 @@ class EAPITestCase(TestCase): "dev-libs/A-7.4": { "EAPI": "4", "IUSE": "foo +bar", "REQUIRED_USE": "|| ( foo bar )" }, "dev-libs/B-1": {"EAPI": 1, "IUSE": "+foo"}, + + #EAPI-7: implicit || ( ) no longer satisfies deps + "dev-libs/C-1": { "EAPI": "6", "IUSE": "foo", "RDEPEND": "|| ( foo? ( dev-libs/B ) )" }, + "dev-libs/C-2": { "EAPI": "7_pre1", "IUSE": "foo", "RDEPEND": "|| ( foo? ( dev-libs/B ) )" }, } test_cases = ( @@ -104,6 +108,9 @@ class EAPITestCase(TestCase): ResolverPlaygroundTestCase(["=dev-libs/A-7.2"], success = False), ResolverPlaygroundTestCase(["=dev-libs/A-7.3"], success = False), ResolverPlaygroundTestCase(["=dev-libs/A-7.4"], success = True, mergelist = ["dev-libs/A-7.4"]), + + ResolverPlaygroundTestCase(["=dev-libs/C-1"], success = True, mergelist = ["dev-libs/C-1"]), + ResolverPlaygroundTestCase(["=dev-libs/C-2"], success = False), ) playground = ResolverPlayground(ebuilds=ebuilds) -- 2.16.2