depgraph minimize_children: yield highest version v2.2.0_alpha1
authorZac Medico <zmedico@gentoo.org>
Sat, 23 Oct 2010 10:33:50 +0000 (03:33 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 23 Oct 2010 10:33:50 +0000 (03:33 -0700)
pym/_emerge/depgraph.py

index 473c9762cd8c8462154fd0345f6d18e087313870..f21d66d2b3f5eaf20025cabac96c0da29c1a7a63 100644 (file)
@@ -1414,7 +1414,10 @@ class depgraph(object):
 
                        for atom in chain(conflict_atoms, normal_atoms):
                                child_pkgs = atom_pkg_graph.child_nodes(atom)
-                               yield (atom, child_pkgs[0])
+                               # if more than one child, yield highest version
+                               if len(child_pkgs) > 1:
+                                       child_pkgs.sort()
+                               yield (atom, child_pkgs[-1])
 
        def _queue_disjunctive_deps(self, pkg, dep_root, dep_priority, dep_struct):
                """