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