1 |
commit: ab07ac68fa1e04ed64e2e0f6c753ff169a32d517 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Dec 5 02:38:49 2016 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 5 04:55:32 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ab07ac68 |
7 |
|
8 |
depgraph: select highest version involved in slot conflict (bug 554070) |
9 |
|
10 |
Fix depgraph's package selection logic to choose the highest version |
11 |
involved in a slot conflict, for correct operation of conflict_downgrade |
12 |
logic in the dep_zapdeps function which was introduced in commit |
13 |
a9064d08ef4c92a5d0d1bfb3dc8a01b7850812b0. This will prevent incorrect |
14 |
re-ordering of || deps in dep_zapdeps, as reported in bug 554070. |
15 |
|
16 |
X-Gentoo-Bug: 554070 |
17 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=554070 |
18 |
Fixes a9064d08ef4c ("Solve more slot-operator conflicts (531656)") |
19 |
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org> |
20 |
|
21 |
pym/_emerge/depgraph.py | 11 +++++++++-- |
22 |
1 file changed, 9 insertions(+), 2 deletions(-) |
23 |
|
24 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
25 |
index 9161914..ee6cf68 100644 |
26 |
--- a/pym/_emerge/depgraph.py |
27 |
+++ b/pym/_emerge/depgraph.py |
28 |
@@ -6071,8 +6071,15 @@ class depgraph(object): |
29 |
# will always end with a break statement below |
30 |
# this point. |
31 |
if find_existing_node: |
32 |
- e_pkg = next(self._dynamic_config._package_tracker.match( |
33 |
- root, pkg.slot_atom, installed=False), None) |
34 |
+ # Use reversed iteration in order to get |
35 |
+ # descending order here, so that the highest |
36 |
+ # version involved in a slot conflict is |
37 |
+ # selected. This is needed for correct operation |
38 |
+ # of conflict_downgrade logic in the dep_zapdeps |
39 |
+ # function (see bug 554070). |
40 |
+ e_pkg = next(reversed(list( |
41 |
+ self._dynamic_config._package_tracker.match( |
42 |
+ root, pkg.slot_atom, installed=False))), None) |
43 |
|
44 |
if not e_pkg: |
45 |
break |