1 |
commit: f68752b7020c66e501b49acc580d023654a96949 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Dec 23 23:15:45 2019 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 23 23:28:19 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f68752b7 |
7 |
|
8 |
_queue_disjunctive_deps: group disjunctions recursively (bug 701996) |
9 |
|
10 |
When disjunctive dependencies are queued, recursively group together |
11 |
disjunctions from the same dependency string so that any overlap between |
12 |
them will trigger expansion to DNF. |
13 |
|
14 |
Fixes: fa7b6ea6ecdc ("_queue_disjunctive_deps: group disjunctions (bug 701996)") |
15 |
Bug: https://bugs.gentoo.org/701996 |
16 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
17 |
|
18 |
lib/_emerge/depgraph.py | 8 ++++---- |
19 |
1 file changed, 4 insertions(+), 4 deletions(-) |
20 |
|
21 |
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py |
22 |
index 83631fe70..2ab1bf4ac 100644 |
23 |
--- a/lib/_emerge/depgraph.py |
24 |
+++ b/lib/_emerge/depgraph.py |
25 |
@@ -3865,20 +3865,20 @@ class depgraph(object): |
26 |
child_pkgs.sort() |
27 |
yield (atom, child_pkgs[-1]) |
28 |
|
29 |
- def _queue_disjunctive_deps(self, pkg, dep_root, dep_priority, dep_struct): |
30 |
+ def _queue_disjunctive_deps(self, pkg, dep_root, dep_priority, dep_struct, _disjunctions_recursive=None): |
31 |
""" |
32 |
Queue disjunctive (virtual and ||) deps in self._dynamic_config._dep_disjunctive_stack. |
33 |
Yields non-disjunctive deps. Raises InvalidDependString when |
34 |
necessary. |
35 |
""" |
36 |
- disjunctions = [] |
37 |
+ disjunctions = [] if _disjunctions_recursive is None else _disjunctions_recursive |
38 |
for x in dep_struct: |
39 |
if isinstance(x, list): |
40 |
if x and x[0] == "||": |
41 |
disjunctions.append(x) |
42 |
else: |
43 |
for y in self._queue_disjunctive_deps( |
44 |
- pkg, dep_root, dep_priority, x): |
45 |
+ pkg, dep_root, dep_priority, x, _disjunctions_recursive=disjunctions): |
46 |
yield y |
47 |
else: |
48 |
# Note: Eventually this will check for PROPERTIES=virtual |
49 |
@@ -3889,7 +3889,7 @@ class depgraph(object): |
50 |
else: |
51 |
yield x |
52 |
|
53 |
- if disjunctions: |
54 |
+ if _disjunctions_recursive is None and disjunctions: |
55 |
self._queue_disjunction(pkg, dep_root, dep_priority, disjunctions) |
56 |
|
57 |
def _queue_disjunction(self, pkg, dep_root, dep_priority, dep_struct): |