commit:     ab07ac68fa1e04ed64e2e0f6c753ff169a32d517
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  5 02:38:49 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec  5 04:55:32 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ab07ac68

depgraph: select highest version involved in slot conflict (bug 554070)

Fix depgraph's package selection logic to choose the highest version
involved in a slot conflict, for correct operation of conflict_downgrade
logic in the dep_zapdeps function which was introduced in commit
a9064d08ef4c92a5d0d1bfb3dc8a01b7850812b0. This will prevent incorrect
re-ordering of || deps in dep_zapdeps, as reported in bug 554070.

X-Gentoo-Bug: 554070
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=554070
Fixes a9064d08ef4c ("Solve more slot-operator conflicts (531656)")
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9161914..ee6cf68 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6071,8 +6071,15 @@ class depgraph(object):
                                        # will always end with a break 
statement below
                                        # this point.
                                        if find_existing_node:
-                                               e_pkg = 
next(self._dynamic_config._package_tracker.match(
-                                                       root, pkg.slot_atom, 
installed=False), None)
+                                               # Use reversed iteration in 
order to get
+                                               # descending order here, so 
that the highest
+                                               # version involved in a slot 
conflict is
+                                               # selected. This is needed for 
correct operation
+                                               # of conflict_downgrade logic 
in the dep_zapdeps
+                                               # function (see bug 554070).
+                                               e_pkg = next(reversed(list(
+                                                       
self._dynamic_config._package_tracker.match(
+                                                       root, pkg.slot_atom, 
installed=False))), None)
 
                                                if not e_pkg:
                                                        break

Reply via email to