aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-02-26 14:09:32 +0100
committerMichał Górny <mgorny@gentoo.org>2018-03-04 22:03:52 +0100
commit9ebd5865559aa17186c23c90c6a90894449dc3ac (patch)
tree98e923f52f6dc7c972735af29f33685cfbe676b2
parentEmpty ||/^^ REQUIRED_USE groups are no longer true in EAPI 7 (diff)
downloadportage-9ebd5865.tar.gz
portage-9ebd5865.tar.bz2
portage-9ebd5865.zip
Empty || *DEPEND group no longer satisfy deps in EAPI 7
Bug: https://bugs.gentoo.org/636596
-rw-r--r--pym/portage/dep/__init__.py3
-rw-r--r--pym/portage/tests/resolver/test_eapi.py9
2 files changed, 11 insertions, 1 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 2a081f3d8..3d4bca08f 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 or _unicode)("__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)