Bug #291142 - Fix some cases when a 'missed update' message might not be
authorZac Medico <zmedico@gentoo.org>
Sat, 7 Nov 2009 01:10:58 +0000 (01:10 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 7 Nov 2009 01:10:58 +0000 (01:10 -0000)
displayed. (trunk r14780)

svn path=/main/branches/2.1.7/; revision=14793

pym/_emerge/depgraph.py

index 70541417a2e41c80817e8d5ca68332ea920dcd7e..0537f9cfe3f7078c64b40547db56a1755e165a60 100644 (file)
@@ -940,7 +940,9 @@ class depgraph(object):
                                                parent_atoms = \
                                                        self._dynamic_config._parent_atoms.get(pkg, set())
                                                if parent_atoms:
-                                                       parent_atoms = self._dynamic_config._slot_conflict_parent_atoms.intersection(parent_atoms)
+                                                       conflict_atoms = self._dynamic_config._slot_conflict_parent_atoms.intersection(parent_atoms)
+                                                       if conflict_atoms:
+                                                               parent_atoms = conflict_atoms
                                                if pkg >= existing_node:
                                                        # We only care about the parent atoms
                                                        # when they trigger a downgrade.
@@ -1337,7 +1339,18 @@ class depgraph(object):
                                if eliminate_pkg:
                                        atom_pkg_graph.remove(pkg)
 
+                       # Yield < and <= atoms first, since those are more likely to
+                       # cause a slot conflicts, and we want those atoms to be displayed
+                       # in the resulting slot conflict message (see bug #291142).
+                       less_than = []
+                       not_less_than = []
                        for atom in cp_atoms:
+                               if atom.operator in ('<', '<='):
+                                       less_than.append(atom)
+                               else:
+                                       not_less_than.append(atom)
+
+                       for atom in chain(less_than, not_less_than):
                                child_pkgs = atom_pkg_graph.child_nodes(atom)
                                yield (atom, child_pkgs[0])