aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2019-12-04 23:11:47 -0800
committerZac Medico <zmedico@gentoo.org>2019-12-05 20:03:28 -0800
commitfa7b6ea6ecdc135a01a65e249276e6d75b92791e (patch)
tree0606825c012185de522879b211c851d9ccc2d31d /lib/_emerge/depgraph.py
parentrepoman commit: ignore unadded hidden files except '.' itself (diff)
downloadportage-fa7b6ea6ecdc135a01a65e249276e6d75b92791e.tar.gz
portage-fa7b6ea6ecdc135a01a65e249276e6d75b92791e.tar.bz2
portage-fa7b6ea6ecdc135a01a65e249276e6d75b92791e.zip
_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@gentoo.org>
Diffstat (limited to 'lib/_emerge/depgraph.py')
-rw-r--r--lib/_emerge/depgraph.py8
1 files changed, 6 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))