diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-07-08 00:53:33 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-07-08 00:53:33 +0000 |
commit | 91f7a0c4f737c310551ddfd7c29456cf6b539796 (patch) | |
tree | 47401a1594222c2b461a4983425aa37d7c5d70e2 | |
parent | 9c123b39251d0b589fd1e4449f8a4815bf4dac66 (diff) | |
download | portage-91f7a0c4f737c310551ddfd7c29456cf6b539796.tar.gz portage-91f7a0c4f737c310551ddfd7c29456cf6b539796.tar.bz2 portage-91f7a0c4f737c310551ddfd7c29456cf6b539796.zip |
Add a MergeListItem.background attribute for putting a task in the background
when max_jobs > 1.
svn path=/main/trunk/; revision=10979
-rw-r--r-- | pym/_emerge/__init__.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 9a9965b61..ba5e7841a 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2834,7 +2834,8 @@ class MergeListItem(CompositeTask): execution support (start, poll, and wait methods). """ - __slots__ = ("args_set", "binpkg_opts", "build_opts", "emerge_opts", + __slots__ = ("args_set", "background", + "binpkg_opts", "build_opts", "emerge_opts", "failed_fetches", "find_blockers", "logger", "mtimedb", "pkg", "pkg_count", "prefetcher", "settings", "world_atom") + \ ("_install_task",) @@ -7987,6 +7988,7 @@ class Scheduler(object): failed_pkgs = self._failed_pkgs task_queues = self._task_queues max_jobs = self._max_jobs + background = max_jobs > 1 while pkg_queue and not failed_pkgs: @@ -7999,7 +8001,7 @@ class Scheduler(object): if not pkg.installed: self._pkg_count.curval += 1 - task = self._task(pkg) + task = self._task(pkg, background) self._jobs += 1 if pkg.installed: @@ -8042,10 +8044,10 @@ class Scheduler(object): if not wait and self._jobs < max_jobs: break - def _task(self, pkg): + def _task(self, pkg, background): task = MergeListItem(args_set=self._args_set, - binpkg_opts=self._binpkg_opts, + background=background, binpkg_opts=self._binpkg_opts, build_opts=self._build_opts, emerge_opts=self.myopts, failed_fetches=self._failed_fetches, |