Add a Scheduler._digraph attribute for use in parallel build scheduling.
authorZac Medico <zmedico@gentoo.org>
Mon, 7 Jul 2008 23:32:11 +0000 (23:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 7 Jul 2008 23:32:11 +0000 (23:32 -0000)
svn path=/main/trunk/; revision=10976

pym/_emerge/__init__.py

index 48e5ca6f2f5a200f71bc8603825cbbad7fda72cb..3c94d61f204d68f0041651e94e34373aea1b94eb 100644 (file)
@@ -7610,6 +7610,7 @@ class Scheduler(object):
                self._pkg_count = self._pkg_count_class(
                        curval=0, maxval=merge_count)
                self._max_jobs = 1
+               self._set_digraph(digraph)
                self._jobs = 0
 
                features = self.settings.features
@@ -7635,6 +7636,13 @@ class Scheduler(object):
                                except EnvironmentError:
                                        pass
 
+       def _set_digraph(self, digraph):
+               if self._max_jobs < 2:
+                       # save some memory
+                       self._digraph = None
+               else:
+                       self._digraph = digraph
+
        class _pkg_failure(portage.exception.PortageException):
                """
                An instance of this class is raised by unmerge() when
@@ -8103,6 +8111,8 @@ class Scheduler(object):
                mylist = mydepgraph.altlist()
                mydepgraph.break_refs(mylist)
                mydepgraph.break_refs(dropped_tasks)
+               mydepgraph.break_refs(mydepgraph.digraph.order)
+               self._set_digraph(mydepgraph.digraph)
                return (mylist, dropped_tasks)
 
        def _show_list(self):