Bug #294945 - Fix blocker satistfied state handling inside depgraph, to
authorZac Medico <zmedico@gentoo.org>
Sat, 28 Nov 2009 22:18:13 +0000 (22:18 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 28 Nov 2009 22:18:13 +0000 (22:18 -0000)
avoid a KeyError when displaying blockers. (trunk r14914)

svn path=/main/branches/2.1.7/; revision=14917

pym/_emerge/depgraph.py

index 684775296a0996f5bda23b81dde4c123898cf9a5..8097637f8d9fa751dc8b71b29ec8f6c947748e28 100644 (file)
@@ -3775,16 +3775,12 @@ class depgraph(object):
                                        # it serves as an indicator that blocking packages
                                        # will be temporarily installed simultaneously.
                                        for blocker in solved_blockers:
-                                               blocker.satisfied = True
                                                retlist.append(blocker)
 
                unsolvable_blockers = set(self._dynamic_config._unsolvable_blockers.leaf_nodes())
                for node in myblocker_uninstalls.root_nodes():
                        unsolvable_blockers.add(node)
 
-               for blocker in unsolvable_blockers:
-                       retlist.append(blocker)
-
                # If any Uninstall tasks need to be executed in order
                # to avoid a conflict, complete the graph with any
                # dependencies that may have been initially
@@ -3796,6 +3792,16 @@ class depgraph(object):
                        self._dynamic_config.myparams["complete"] = True
                        raise self._serialize_tasks_retry("")
 
+               # Set satisfied state on blockers, but not before the
+               # above retry path, since we don't want to modify the
+               # state in that case.
+               for node in retlist:
+                       if isinstance(node, Blocker):
+                               node.satisfied = True
+
+               for blocker in unsolvable_blockers:
+                       retlist.append(blocker)
+
                if unsolvable_blockers and \
                        not self._accept_blocker_conflicts():
                        self._dynamic_config._unsatisfied_blockers_for_display = unsolvable_blockers