1 |
This fixes the check_reverse_dependencies function (inside the depgraph |
2 |
_slot_operator_update_probe method) to account for irrelevant parent |
3 |
atoms from parents that need to be rebuilt or have been involved in |
4 |
unsolved slot conflicts. |
5 |
|
6 |
X-Gentoo-Bug: 520856 |
7 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=520856 |
8 |
--- |
9 |
pym/_emerge/depgraph.py | 35 +++++++++++++++++++++++++++++++---- |
10 |
1 file changed, 31 insertions(+), 4 deletions(-) |
11 |
|
12 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
13 |
index 845a43a..d6cd24d 100644 |
14 |
--- a/pym/_emerge/depgraph.py |
15 |
+++ b/pym/_emerge/depgraph.py |
16 |
@@ -1567,14 +1567,40 @@ class depgraph(object): |
17 |
selective = "selective" in self._dynamic_config.myparams |
18 |
want_downgrade = None |
19 |
|
20 |
- def check_reverse_dependencies(existing_pkg, candidate_pkg): |
21 |
+ def check_reverse_dependencies(existing_pkg, candidate_pkg, |
22 |
+ replacement_parent=None): |
23 |
""" |
24 |
Check if candidate_pkg satisfies all of existing_pkg's non- |
25 |
slot operator parents. |
26 |
""" |
27 |
+ built_slot_operator_parents = set() |
28 |
for parent, atom in self._dynamic_config._parent_atoms.get(existing_pkg, []): |
29 |
- if atom.slot_operator == "=" and getattr(parent, "built", False): |
30 |
- continue |
31 |
+ if atom.slot_operator_built: |
32 |
+ built_slot_operator_parents.add(parent) |
33 |
+ |
34 |
+ for parent, atom in self._dynamic_config._parent_atoms.get(existing_pkg, []): |
35 |
+ if isinstance(parent, Package): |
36 |
+ if parent in built_slot_operator_parents: |
37 |
+ # This parent may need to be rebuilt, so its |
38 |
+ # dependencies aren't necessarily relevant. |
39 |
+ continue |
40 |
+ |
41 |
+ if replacement_parent is not None and \ |
42 |
+ (replacement_parent.slot_atom == parent.slot_atom |
43 |
+ or replacement_parent.cpv == parent.cpv): |
44 |
+ # This parent is irrelevant because we intend to |
45 |
+ # replace it with replacement_parent. |
46 |
+ continue |
47 |
+ |
48 |
+ if any(pkg is not parent and |
49 |
+ (pkg.slot_atom == parent.slot_atom or |
50 |
+ pkg.cpv == parent.cpv) for pkg in |
51 |
+ self._dynamic_config._package_tracker.match( |
52 |
+ parent.root, Atom(parent.cp))): |
53 |
+ # This parent may need to be eliminated due to a |
54 |
+ # slot conflict, so its dependencies aren't |
55 |
+ # necessarily relevant. |
56 |
+ continue |
57 |
|
58 |
atom_set = InternalPackageSet(initial_atoms=(atom,), |
59 |
allow_repo=True) |
60 |
@@ -1693,7 +1719,8 @@ class depgraph(object): |
61 |
continue |
62 |
|
63 |
if not insignificant and \ |
64 |
- check_reverse_dependencies(dep.child, pkg): |
65 |
+ check_reverse_dependencies(dep.child, pkg, |
66 |
+ replacement_parent=replacement_parent): |
67 |
|
68 |
candidate_pkg_atoms.append((pkg, unevaluated_atom)) |
69 |
candidate_pkgs.append(pkg) |
70 |
-- |
71 |
1.8.1.5 |