summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-08 05:49:27 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-08 05:49:27 +0000
commit7e357605c8d9d44839be3fb755a6563eaf398088 (patch)
tree0ff5b66f68ab84c148605e6bb6efb05248569990
parent1a70ed5ce5f06e1c2cfa575dc42d452f828dfb10 (diff)
downloadportage-7e357605c8d9d44839be3fb755a6563eaf398088.tar.gz
portage-7e357605c8d9d44839be3fb755a6563eaf398088.tar.bz2
portage-7e357605c8d9d44839be3fb755a6563eaf398088.zip
* Add background support to the SpawProcess class.
* Make Binpkg pass the current background setting into subtasks. svn path=/main/trunk/; revision=10982
-rw-r--r--pym/_emerge/__init__.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 748c018f0..0071fd25b 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -1774,6 +1774,9 @@ class SpawnProcess(SubProcess):
# Create a dummy pipe so the scheduler can monitor
# the process from inside a poll() loop.
fd_pipes[self._dummy_pipe_fd] = slave_fd
+ if self.background:
+ fd_pipes[1] = slave_fd
+ fd_pipes[2] = slave_fd
output_handler = self._dummy_handler
kwargs = {}
@@ -2499,7 +2502,8 @@ class Binpkg(CompositeTask):
pkg = self.pkg
pkg_count = self.pkg_count
- fetcher = BinpkgFetcher(pkg=self.pkg, scheduler=self.scheduler)
+ fetcher = BinpkgFetcher(background=self.background,
+ pkg=self.pkg, scheduler=self.scheduler)
pkg_path = fetcher.pkg_path
self._pkg_path = pkg_path
@@ -2531,7 +2535,7 @@ class Binpkg(CompositeTask):
verifier = None
if self._verify:
- verifier = BinpkgVerifier(pkg=self.pkg)
+ verifier = BinpkgVerifier(background=self.background, pkg=self.pkg)
self._start_task(verifier, self._verifier_exit)
return
@@ -2562,7 +2566,7 @@ class Binpkg(CompositeTask):
settings = self.settings
settings.setcpv(pkg)
settings["EBUILD"] = self._ebuild_path
- ebuild_phase = EbuildPhase(
+ ebuild_phase = EbuildPhase(background=self.background,
pkg=pkg, phase=phase, scheduler=self.scheduler,
settings=settings, tree=self._tree)
@@ -2634,7 +2638,7 @@ class Binpkg(CompositeTask):
settings.backup_changes("PORTAGE_BINPKG_FILE")
phase = "setup"
- ebuild_phase = EbuildPhase(
+ ebuild_phase = EbuildPhase(background=self.background,
pkg=self.pkg, phase=phase, scheduler=self.scheduler,
settings=settings, tree=self._tree)
@@ -2645,7 +2649,8 @@ class Binpkg(CompositeTask):
self._unlock_builddir()
return
- extractor = BinpkgExtractorAsync(image_dir=self._image_dir,
+ extractor = BinpkgExtractorAsync(background=self.background,
+ image_dir=self._image_dir,
pkg=self.pkg, pkg_path=self._pkg_path, scheduler=self.scheduler)
portage.writemsg_stdout(">>> Extracting %s\n" % self.pkg.cpv)
self._start_task(extractor, self._extractor_exit)