Use a separate digraph to preserve irrelevant blocker relationships that
authorZac Medico <zmedico@gentoo.org>
Mon, 5 May 2008 03:27:58 +0000 (03:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 5 May 2008 03:27:58 +0000 (03:27 -0000)
are removed from depgraph._blocker_parents since the irrelevant blockers
are still needed for the blocker cache. (trunk r10188)

svn path=/main/branches/2.1.2/; revision=10189

bin/emerge

index 5556f93681634fd0ee292cde026db1875316644a..a476fd9e3698066f671e4e5d3caecb220a1aee5e 100755 (executable)
@@ -1934,6 +1934,8 @@ class depgraph(object):
                self._blocker_uninstalls = digraph()
                # Contains only Package -> Blocker edges
                self._blocker_parents = digraph()
+               # Contains only irrelevant Package -> Blocker edges
+               self._irrelevant_blockers = digraph()
                # Contains only unsolvable Package -> Blocker edges
                self._unsolvable_blockers = digraph()
                self._slot_collision_info = set()
@@ -3325,10 +3327,17 @@ class depgraph(object):
                                        blocker_atoms = None
                                        blockers = None
                                        if self.digraph.contains(pkg):
+                                               blockers = []
                                                try:
-                                                       blockers = self._blocker_parents.child_nodes(pkg)
+                                                       blockers.extend(
+                                                               self._blocker_parents.child_nodes(pkg))
                                                except KeyError:
-                                                       blockers = []
+                                                       pass
+                                               try:
+                                                       blockers.extend(
+                                                               self._irrelevant_blockers.child_nodes(pkg))
+                                               except KeyError:
+                                                       pass
                                        if blockers is not None:
                                                blockers = set("!" + blocker.atom \
                                                        for blocker in blockers)
@@ -3460,6 +3469,7 @@ class depgraph(object):
                                self._blocker_parents.remove(blocker)
                                # Discard any parents that don't have any more blockers.
                                for pkg in parent_pkgs:
+                                       self._irrelevant_blockers.add(blocker, pkg)
                                        if not self._blocker_parents.child_nodes(pkg):
                                                self._blocker_parents.remove(pkg)
                                continue
@@ -3534,6 +3544,7 @@ class depgraph(object):
                                                # merged.
                                                self._blocker_uninstalls.addnode(uninst_task, blocker)
                                if not unresolved_blocks and not depends_on_order:
+                                       self._irrelevant_blockers.add(blocker, parent)
                                        self._blocker_parents.remove_edge(blocker, parent)
                                        if not self._blocker_parents.parent_nodes(blocker):
                                                self._blocker_parents.remove(blocker)