Inside depgraph._add_pkg(), handle the case where multiple different
authorZac Medico <zmedico@gentoo.org>
Sat, 15 Nov 2008 21:21:02 +0000 (21:21 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 15 Nov 2008 21:21:02 +0000 (21:21 -0000)
instances of the same version (typically one installed and another not yet
installed) have been pulled into the graph due to a USE dependency. The "slot
collision" display is not helpful in a case like this, so display it as an
unsatisfied dependency. Thanks to Peter Volkov <pva@g.o> for reporting.
(trunk r11954)

svn path=/main/branches/2.1.6/; revision=11955

pym/_emerge/__init__.py

index c1ee71ef0f0567390a73114302251f849ad04046..5b672a853ff3b8f3eb9a0b896a412881844fd83c 100644 (file)
@@ -4573,6 +4573,20 @@ class depgraph(object):
                                                        priority=priority)
                                        return 1
                                else:
+
+                                       if pkg.cpv == existing_node.cpv and \
+                                               dep.atom is not None and \
+                                               dep.atom.use:
+                                               # Multiple different instances of the same version
+                                               # (typically one installed and another not yet
+                                               # installed) have been pulled into the graph due
+                                               # to a USE dependency. The "slot collision" display
+                                               # is not helpful in a case like this, so display it
+                                               # as an unsatisfied dependency.
+                                               self._unsatisfied_deps_for_display.append(
+                                                       ((dep.root, dep.atom), {"myparent":dep.parent}))
+                                               return 0
+
                                        if pkg in self._slot_collision_nodes:
                                                return 1
                                        # A slot collision has occurred.  Sometimes this coincides