depgraph minimize_children: yield highest version v2.1.9.22
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:39:32 +0000 (03:39 -0700)
pym/_emerge/depgraph.py

index 35512fc169853972f711124d838c2d98cc4ec486..eea7964de4191f5cfff1e386eb03f7fe0e90f951 100644 (file)
@@ -1431,7 +1431,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):
                """