Revert r12405 since it will be more convenient to use a separate graph to
authorZac Medico <zmedico@gentoo.org>
Sat, 10 Jan 2009 04:03:19 +0000 (04:03 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 10 Jan 2009 04:03:19 +0000 (04:03 -0000)
store blocked package edges.

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

pym/_emerge/__init__.py

index 180ad44dc2dcf44bab55a49fd1ecf0132adea73d..fb4937bfb828c768990a05fe09f9bbc0d82a7fbd 100644 (file)
@@ -4482,7 +4482,7 @@ class depgraph(object):
                self._blocker_parents = digraph()
                # Contains only irrelevant Package -> Blocker edges
                self._irrelevant_blockers = digraph()
-               # Contains only unsolvable Package -> Blocker -> Blocked Package edges
+               # Contains only unsolvable Package -> Blocker edges
                self._unsolvable_blockers = digraph()
                self._slot_collision_info = {}
                # Slot collision nodes are not allowed to block other packages since
@@ -6429,7 +6429,7 @@ class depgraph(object):
                                                self._blocker_parents.remove(pkg)
                                continue
                        for parent in self._blocker_parents.parent_nodes(blocker):
-                               unresolved_blocks = set()
+                               unresolved_blocks = False
                                depends_on_order = set()
                                for pkg in blocked_initial:
                                        if pkg.slot_atom == parent.slot_atom:
@@ -6451,7 +6451,7 @@ class depgraph(object):
                                                continue
                                        # None of the above blocker resolutions techniques apply,
                                        # so apparently this one is unresolvable.
-                                       unresolved_blocks.add(pkg)
+                                       unresolved_blocks = True
                                for pkg in blocked_final:
                                        if pkg.slot_atom == parent.slot_atom:
                                                # TODO: Support blocks within slots.
@@ -6472,7 +6472,16 @@ class depgraph(object):
                                                continue
                                        # None of the above blocker resolutions techniques apply,
                                        # so apparently this one is unresolvable.
-                                       unresolved_blocks.add(pkg)
+                                       unresolved_blocks = True
+
+                               # Make sure we don't unmerge any package that have been pulled
+                               # into the graph.
+                               if not unresolved_blocks and depends_on_order:
+                                       for inst_pkg, inst_task in depends_on_order:
+                                               if self.digraph.contains(inst_pkg) and \
+                                                       self.digraph.parent_nodes(inst_pkg):
+                                                       unresolved_blocks = True
+                                                       break
 
                                if not unresolved_blocks and depends_on_order:
                                        for inst_pkg, inst_task in depends_on_order:
@@ -6499,8 +6508,6 @@ class depgraph(object):
                                                self._blocker_parents.remove(parent)
                                if unresolved_blocks:
                                        self._unsolvable_blockers.add(blocker, parent)
-                                       for pkg in unresolved_blocks:
-                                               self._unsolvable_blockers.add(pkg, blocker)
 
                return True
 
@@ -7105,8 +7112,7 @@ class depgraph(object):
                                                        root=blocker.root, eapi=blocker.eapi,
                                                        satisfied=True))
 
-               unsolvable_blockers = set(node for node in \
-                       self._unsolvable_blockers if isinstance(node, Blocker))
+               unsolvable_blockers = set(self._unsolvable_blockers.leaf_nodes())
                for node in myblocker_uninstalls.root_nodes():
                        unsolvable_blockers.add(node)