For bug #176765, when a new package is blocked by another one that is being replaced...
authorZac Medico <zmedico@gentoo.org>
Thu, 3 May 2007 09:18:36 +0000 (09:18 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 3 May 2007 09:18:36 +0000 (09:18 -0000)
svn path=/main/trunk/; revision=6473

pym/emerge/__init__.py

index 5574d9327d5ee5c0f4b9dbe3cc09138469e024a3..3ee134c5dc64816dfd722554525673684aed6cc6 100644 (file)
@@ -1933,7 +1933,7 @@ class depgraph:
                                                        # this block.
                                                        upgrade_node = \
                                                                self.pkg_node_map[proot][upgrade_matches[0]]
-                                                       depends_on_order.add(upgrade_node)
+                                                       depends_on_order.add((upgrade_node, parent))
                                                        continue
                                        # None of the above blocker resolutions techniques apply,
                                        # so apparently this one is unresolvable.
@@ -1949,13 +1949,27 @@ class depgraph:
                                                # This blocker will be handled the next time that a
                                                # merge of either package is triggered.
                                                continue
+                                       if not parent_static and pstatus == "nomerge" and \
+                                               slot_atom in modified_slots[myroot]:
+                                               replacement = final_db.match(pslot_atom)
+                                               if replacement:
+                                                       replacement_node = \
+                                                               self.pkg_node_map[proot][replacement[0]]
+                                                       if replacement_node not in \
+                                                               self.blocker_parents[blocker]:
+                                                               # Apparently a replacement may be able to
+                                                               # invalidate this block.
+                                                               blocked_node = self.pkg_node_map[proot][cpv]
+                                                               depends_on_order.add(
+                                                                       (replacement_node, blocked_node))
+                                                               continue
                                        # None of the above blocker resolutions techniques apply,
                                        # so apparently this one is unresolvable.
                                        unresolved_blocks = True
                                if not unresolved_blocks and depends_on_order:
-                                       for node in depends_on_order:
+                                       for node, pnode in depends_on_order:
                                                # Enforce correct merge order with a hard dep.
-                                               self.digraph.addnode(node, parent,
+                                               self.digraph.addnode(node, pnode,
                                                        priority=DepPriority(buildtime=True))
                                                # Count references to this blocker so that it can be
                                                # invalidated after nodes referencing it have been