From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/, lib/_emerge/
Date: Fri, 6 Dec 2019 04:06:39 +0000 (UTC) [thread overview]
Message-ID: <1575605008.fa7b6ea6ecdc135a01a65e249276e6d75b92791e.zmedico@gentoo> (raw)
commit: fa7b6ea6ecdc135a01a65e249276e6d75b92791e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 5 07:11:47 2019 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec 6 04:03:28 2019 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=fa7b6ea6
_queue_disjunctive_deps: group disjunctions (bug 701996)
When disjunctive dependencies are queued, group together disjunctions
from the same dependency string so that any overlap between them will
trigger expansion to DNF.
Bug: https://bugs.gentoo.org/701996
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
lib/_emerge/depgraph.py | 8 +++--
.../resolver/test_virtual_minimize_children.py | 39 ++++++++++++++++++++++
2 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index f80b077bc..78226a3ea 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -3850,10 +3850,11 @@ class depgraph(object):
Yields non-disjunctive deps. Raises InvalidDependString when
necessary.
"""
+ disjunctions = []
for x in dep_struct:
if isinstance(x, list):
if x and x[0] == "||":
- self._queue_disjunction(pkg, dep_root, dep_priority, [x])
+ disjunctions.append(x)
else:
for y in self._queue_disjunctive_deps(
pkg, dep_root, dep_priority, x):
@@ -3863,10 +3864,13 @@ class depgraph(object):
# or whatever other metadata gets implemented for this
# purpose.
if x.cp.startswith('virtual/'):
- self._queue_disjunction(pkg, dep_root, dep_priority, [x])
+ disjunctions.append(x)
else:
yield x
+ if disjunctions:
+ self._queue_disjunction(pkg, dep_root, dep_priority, disjunctions)
+
def _queue_disjunction(self, pkg, dep_root, dep_priority, dep_struct):
self._dynamic_config._dep_disjunctive_stack.append(
(pkg, dep_root, dep_priority, dep_struct))
diff --git a/lib/portage/tests/resolver/test_virtual_minimize_children.py b/lib/portage/tests/resolver/test_virtual_minimize_children.py
index b566cb592..720fbe57b 100644
--- a/lib/portage/tests/resolver/test_virtual_minimize_children.py
+++ b/lib/portage/tests/resolver/test_virtual_minimize_children.py
@@ -285,3 +285,42 @@ class VirtualMinimizeChildrenTestCase(TestCase):
finally:
playground.debug = False
playground.cleanup()
+
+
+ def testVirtualWine(self):
+ ebuilds = {
+ 'virtual/wine-0-r6': {
+ 'RDEPEND': '|| ( app-emulation/wine-staging app-emulation/wine-any ) '
+ '|| ( app-emulation/wine-vanilla app-emulation/wine-staging app-emulation/wine-any )'
+ },
+ 'app-emulation/wine-staging-4': {},
+ 'app-emulation/wine-any-4': {},
+ 'app-emulation/wine-vanilla-4': {},
+ }
+
+ test_cases = (
+ # Test bug 701996, where separate disjunctions where not
+ # converted to DNF, causing both wine-vanilla and
+ # wine-staging to be pulled in.
+ ResolverPlaygroundTestCase(
+ [
+ 'virtual/wine',
+ ],
+ success=True,
+ mergelist=(
+ 'app-emulation/wine-staging-4',
+ 'virtual/wine-0-r6',
+ ),
+ ),
+ )
+
+ playground = ResolverPlayground(debug=False, ebuilds=ebuilds)
+
+ try:
+ for test_case in test_cases:
+ playground.run_TestCase(test_case)
+ self.assertEqual(test_case.test_success, True,
+ test_case.fail_msg)
+ finally:
+ playground.debug = False
+ playground.cleanup()
next reply other threads:[~2019-12-06 4:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-06 4:06 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-01-08 8:58 [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/, lib/_emerge/ Zac Medico
2023-12-26 21:05 Zac Medico
2023-11-29 19:55 Zac Medico
2023-11-25 6:30 Zac Medico
2021-01-11 7:27 Zac Medico
2020-12-02 8:32 Zac Medico
2020-08-31 6:22 Zac Medico
2020-04-12 1:52 Zac Medico
2020-03-14 20:57 Zac Medico
2020-02-15 0:58 Zac Medico
2019-12-26 23:00 Zac Medico
2019-11-26 20:35 Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1575605008.fa7b6ea6ecdc135a01a65e249276e6d75b92791e.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox