Bug #270953 - New !!atom blockers do not allow temporary simulaneous
authorZac Medico <zmedico@gentoo.org>
Sat, 27 Jun 2009 19:39:46 +0000 (19:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 27 Jun 2009 19:39:46 +0000 (19:39 -0000)
installation, so unlike !atom blockers, !!atom blockers aren't ignored
when they match other packages occupying the same slot. Thanks to
Sebastian Mingramm (few) <s.mingramm@gmx.de> for the initial patch.

svn path=/main/trunk/; revision=13716

pym/_emerge/depgraph.py

index 9e5ddac288c0c442522943c1a887026c3c8f7712..371c0b1ea925b0f729b833b9e88f0bad10106d88 100644 (file)
@@ -2446,11 +2446,13 @@ class depgraph(object):
                                unresolved_blocks = False
                                depends_on_order = set()
                                for pkg in blocked_initial:
-                                       if pkg.slot_atom == parent.slot_atom:
-                                               # TODO: Support blocks within slots in cases where it
-                                               # might make sense.  For example, a new version might
-                                               # require that the old version be uninstalled at build
-                                               # time.
+                                       if pkg.slot_atom == parent.slot_atom and \
+                                               not blocker.atom.blocker.overlap.forbid:
+                                               # New !!atom blockers do not allow temporary
+                                               # simulaneous installation, so unlike !atom
+                                               # blockers, !!atom blockers aren't ignored
+                                               # when they match other packages occupying
+                                               # the same slot.
                                                continue
                                        if parent.installed:
                                                # Two currently installed packages conflict with
@@ -2470,8 +2472,13 @@ class depgraph(object):
                                        # so apparently this one is unresolvable.
                                        unresolved_blocks = True
                                for pkg in blocked_final:
-                                       if pkg.slot_atom == parent.slot_atom:
-                                               # TODO: Support blocks within slots.
+                                       if pkg.slot_atom == parent.slot_atom and \
+                                               not blocker.atom.blocker.overlap.forbid:
+                                               # New !!atom blockers do not allow temporary
+                                               # simulaneous installation, so unlike !atom
+                                               # blockers, !!atom blockers aren't ignored
+                                               # when they match other packages occupying
+                                               # the same slot.
                                                continue
                                        if parent.operation == "nomerge" and \
                                                pkg.operation == "nomerge":