* Fix _choose_pkg() to pop the first node if there are no other jobs running.
authorZac Medico <zmedico@gentoo.org>
Tue, 8 Jul 2008 23:42:28 +0000 (23:42 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 8 Jul 2008 23:42:28 +0000 (23:42 -0000)
* Allow _choose_pkg() to choose an uninstall node when it reaches the front
  of the queue. TODO: fix order for uninstall operations.
* Fix _dependent_on_scheduled_merges() to handle direct circular deps
  correctly.

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

pym/_emerge/__init__.py

index 807c3342ad1a071250060f8dadd0411de848c186..8ef659ab54b402a768be08add711e78f1d695978 100644 (file)
@@ -8102,7 +8102,11 @@ class Scheduler(object):
                return rval
 
        def _choose_pkg(self):
-               if self._max_jobs < 2:
+               """
+               TODO: fix order for uninstall operations
+               """
+               if self._max_jobs < 2 or self._jobs == 0 or \
+                       self._pkg_queue[0].operation == "uninstall":
                        return self._pkg_queue.pop(0)
 
                self._prune_digraph()
@@ -8131,7 +8135,7 @@ class Scheduler(object):
                completed_tasks = self._completed_tasks
 
                dependent = False
-               traversed_nodes = set()
+               traversed_nodes = set([pkg])
                node_stack = graph.child_nodes(pkg)
                while node_stack:
                        node = node_stack.pop()