1 |
Fix check_reverse_dependencies to ignore dependencies of parent packages |
2 |
for which updates are desirable, and add required _want_update_pkg |
3 |
support for DependencyArg parents. This solves a missed llvm update by |
4 |
ignoring a reverse dependency from the installed instance of clang, |
5 |
since an update to a newer version of clang is desirable. |
6 |
|
7 |
In order to cope with this change, there are 2 existing unit tests |
8 |
that require larger --backtrack settings in order to succeed. |
9 |
|
10 |
X-Gentoo-Bug: 584626 |
11 |
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=584626 |
12 |
--- |
13 |
pym/_emerge/depgraph.py | 40 ++++++++++++++++++++-- |
14 |
.../soname/test_slot_conflict_reinstall.py | 1 + |
15 |
.../tests/resolver/test_slot_conflict_rebuild.py | 2 +- |
16 |
.../resolver/test_slot_operator_reverse_deps.py | 6 +++- |
17 |
4 files changed, 44 insertions(+), 5 deletions(-) |
18 |
|
19 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
20 |
index f78f08d..ef3cc5d 100644 |
21 |
--- a/pym/_emerge/depgraph.py |
22 |
+++ b/pym/_emerge/depgraph.py |
23 |
@@ -1822,6 +1822,22 @@ class depgraph(object): |
24 |
# necessarily relevant. |
25 |
continue |
26 |
|
27 |
+ if (not self._frozen_config.excluded_pkgs. |
28 |
+ findAtomForPackage(parent, |
29 |
+ modified_use=self._pkg_use_enabled(parent)) and |
30 |
+ self._upgrade_available(parent)): |
31 |
+ want_update = False |
32 |
+ for grandparent in self._dynamic_config.digraph.\ |
33 |
+ parent_nodes(parent): |
34 |
+ if self._want_update_pkg(grandparent, parent): |
35 |
+ want_update = True |
36 |
+ break |
37 |
+ |
38 |
+ if want_update: |
39 |
+ # This parent may be irrelevant, since an |
40 |
+ # update is available (see bug 584626). |
41 |
+ continue |
42 |
+ |
43 |
atom_set = InternalPackageSet(initial_atoms=(atom,), |
44 |
allow_repo=True) |
45 |
if not atom_set.findAtomForPackage(candidate_pkg, |
46 |
@@ -2113,6 +2129,19 @@ class depgraph(object): |
47 |
|
48 |
self._dynamic_config._need_restart = True |
49 |
|
50 |
+ def _upgrade_available(self, pkg): |
51 |
+ """ |
52 |
+ Detect cases where an upgrade of the given package is available |
53 |
+ within the same slot. |
54 |
+ """ |
55 |
+ available_pkg = None |
56 |
+ for available_pkg in self._iter_similar_available(pkg, |
57 |
+ pkg.slot_atom): |
58 |
+ if available_pkg >= pkg: |
59 |
+ return True |
60 |
+ |
61 |
+ return False |
62 |
+ |
63 |
def _downgrade_probe(self, pkg): |
64 |
""" |
65 |
Detect cases where a downgrade of the given package is considered |
66 |
@@ -5382,9 +5411,14 @@ class depgraph(object): |
67 |
# should have been masked before it was selected |
68 |
raise |
69 |
|
70 |
- depth = parent.depth or 0 |
71 |
- if isinstance(depth, int): |
72 |
- depth += 1 |
73 |
+ if isinstance(parent, Package): |
74 |
+ depth = parent.depth or 0 |
75 |
+ if isinstance(depth, int): |
76 |
+ depth += 1 |
77 |
+ elif parent.reset_depth: |
78 |
+ depth = 0 |
79 |
+ else: |
80 |
+ depth = self._UNREACHABLE_DEPTH |
81 |
|
82 |
if arg_atoms: |
83 |
for arg, atom in arg_atoms: |
84 |
diff --git a/pym/portage/tests/resolver/soname/test_slot_conflict_reinstall.py b/pym/portage/tests/resolver/soname/test_slot_conflict_reinstall.py |
85 |
index 40e6995..f474761 100644 |
86 |
--- a/pym/portage/tests/resolver/soname/test_slot_conflict_reinstall.py |
87 |
+++ b/pym/portage/tests/resolver/soname/test_slot_conflict_reinstall.py |
88 |
@@ -89,6 +89,7 @@ class SonameSlotConflictReinstallTestCase(TestCase): |
89 |
"--ignore-soname-deps": "n", |
90 |
"--update": True, |
91 |
"--usepkgonly": True, |
92 |
+ "--backtrack": 10, |
93 |
}, |
94 |
success = True, |
95 |
mergelist = [ |
96 |
diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py |
97 |
index b39eaf0..2dfa79c 100644 |
98 |
--- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py |
99 |
+++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py |
100 |
@@ -91,7 +91,7 @@ class SlotConflictRebuildTestCase(TestCase): |
101 |
# upgrade and we don't want to trigger unnecessary rebuilds. |
102 |
ResolverPlaygroundTestCase( |
103 |
["@world"], |
104 |
- options = {"--update": True, "--deep": True}, |
105 |
+ options = {"--update": True, "--deep": True, "--backtrack": 4}, |
106 |
success = True, |
107 |
mergelist = ["app-misc/D-2", "app-misc/E-0"]), |
108 |
|
109 |
diff --git a/pym/portage/tests/resolver/test_slot_operator_reverse_deps.py b/pym/portage/tests/resolver/test_slot_operator_reverse_deps.py |
110 |
index 72879f8..ce614a4 100644 |
111 |
--- a/pym/portage/tests/resolver/test_slot_operator_reverse_deps.py |
112 |
+++ b/pym/portage/tests/resolver/test_slot_operator_reverse_deps.py |
113 |
@@ -79,7 +79,11 @@ class SlotOperatorReverseDepsTestCase(TestCase): |
114 |
["@world"], |
115 |
options = {"--update": True, "--deep": True}, |
116 |
success = True, |
117 |
- mergelist = [], |
118 |
+ mergelist = [ |
119 |
+ 'sys-devel/llvm-3.8.0-r2', |
120 |
+ 'sys-devel/clang-3.8.0-r100', |
121 |
+ 'media-libs/mesa-11.2.2', |
122 |
+ ], |
123 |
), |
124 |
|
125 |
ResolverPlaygroundTestCase( |
126 |
-- |
127 |
2.7.4 |