1 |
commit: 5a65670ec2b0850c278b85c6417c20d8a4ca7734 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 29 07:02:27 2017 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 29 17:22:27 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a65670e |
7 |
|
8 |
_solve_..slot_conflicts: make "forced" set recursive (bug 632210) |
9 |
|
10 |
When the slot conflict solver decides that it is "forced" |
11 |
to choose a particular package, recursively force the |
12 |
dependencies as well. Prior to this fix, substitution of |
13 |
@world in the arguments for SlotConflictMaskUpdateTestCase |
14 |
caused the test to fail because the solver removed |
15 |
boost-build-1.53.0 from the graph event though it had |
16 |
added the parent boost-1.53.0 package to the "forced" |
17 |
set. |
18 |
|
19 |
X-Gentoo-bug: 632210 |
20 |
X-Gentoo-bug-url: https://bugs.gentoo.org/632210 |
21 |
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org> |
22 |
|
23 |
pym/_emerge/depgraph.py | 13 +++++++++++++ |
24 |
pym/portage/tests/resolver/test_slot_conflict_update.py | 2 +- |
25 |
2 files changed, 14 insertions(+), 1 deletion(-) |
26 |
|
27 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
28 |
index 785c036b8..3b81c5c76 100644 |
29 |
--- a/pym/_emerge/depgraph.py |
30 |
+++ b/pym/_emerge/depgraph.py |
31 |
@@ -1457,6 +1457,19 @@ class depgraph(object): |
32 |
|
33 |
# Remove 'non_conflict_node' and or_tuples from 'forced'. |
34 |
forced = set(pkg for pkg in forced if isinstance(pkg, Package)) |
35 |
+ |
36 |
+ # Add dependendencies of forced packages. |
37 |
+ stack = list(forced) |
38 |
+ traversed = set() |
39 |
+ while stack: |
40 |
+ pkg = stack.pop() |
41 |
+ traversed.add(pkg) |
42 |
+ for child in conflict_graph.child_nodes(pkg): |
43 |
+ if (isinstance(child, Package) and |
44 |
+ child not in traversed): |
45 |
+ forced.add(child) |
46 |
+ stack.append(child) |
47 |
+ |
48 |
non_forced = set(pkg for pkg in conflict_pkgs if pkg not in forced) |
49 |
|
50 |
if debug: |
51 |
|
52 |
diff --git a/pym/portage/tests/resolver/test_slot_conflict_update.py b/pym/portage/tests/resolver/test_slot_conflict_update.py |
53 |
index 331e5788b..f251d01f1 100644 |
54 |
--- a/pym/portage/tests/resolver/test_slot_conflict_update.py |
55 |
+++ b/pym/portage/tests/resolver/test_slot_conflict_update.py |
56 |
@@ -80,7 +80,7 @@ class SlotConflictUpdateTestCase(TestCase): |
57 |
# this behavior makes SlotConflictMaskUpdateTestCase |
58 |
# fail. |
59 |
ResolverPlaygroundTestCase( |
60 |
- world, |
61 |
+ ['@world'], |
62 |
all_permutations = True, |
63 |
options = {"--update": True, "--deep": True}, |
64 |
success = True, |