From ee8a242c4982d1254c29681061548ea343d51a28 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 5 May 2008 03:27:30 +0000 Subject: [PATCH] Use a separate digraph to preserve irrelevant blocker relationships that are removed from depgraph._blocker_parents since the irrelevant blockers are still needed for the blocker cache. svn path=/main/trunk/; revision=10188 --- pym/_emerge/__init__.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 127a73e65..3b7842f66 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1793,6 +1793,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() @@ -3174,10 +3176,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) @@ -3309,6 +3318,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 @@ -3383,6 +3393,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) -- 2.26.2