From: Zac Medico Date: Tue, 8 Jan 2013 01:48:11 +0000 (-0800) Subject: ManifestTask: use PipeLogger for monitoring X-Git-Tag: v2.2.0_alpha150~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f254a3a8135e9b32ae931dffdc36c4fbfe813cc3;p=portage.git ManifestTask: use PipeLogger for monitoring --- diff --git a/pym/portage/package/ebuild/_parallel_manifest/ManifestTask.py b/pym/portage/package/ebuild/_parallel_manifest/ManifestTask.py index e2d023a8c..0ee2b910d 100644 --- a/pym/portage/package/ebuild/_parallel_manifest/ManifestTask.py +++ b/pym/portage/package/ebuild/_parallel_manifest/ManifestTask.py @@ -1,4 +1,4 @@ -# Copyright 2012 Gentoo Foundation +# Copyright 2012-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import errno @@ -10,6 +10,7 @@ from portage import _unicode_encode, _encodings from portage.const import MANIFEST2_IDENTIFIERS from portage.util import (atomic_ofstream, grablines, shlex_split, varexpand, writemsg) +from portage.util._async.PipeLogger import PipeLogger from portage.util._async.PopenProcess import PopenProcess from _emerge.CompositeTask import CompositeTask from _emerge.PipeReader import PipeReader @@ -144,7 +145,12 @@ class ManifestTask(CompositeTask): gpg_vars["FILE"] = self._manifest_path gpg_cmd = varexpand(self.gpg_cmd, mydict=gpg_vars) gpg_cmd = shlex_split(gpg_cmd) - gpg_proc = PopenProcess(proc=subprocess.Popen(gpg_cmd)) + gpg_proc = PopenProcess(proc=subprocess.Popen(gpg_cmd, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) + # PipeLogger echos output and efficiently monitors for process + # exit by listening for the stdout EOF event. + gpg_proc.pipe_reader = PipeLogger(background=self.background, + input_fd=gpg_proc.proc.stdout, scheduler=self.scheduler) self._start_task(gpg_proc, self._gpg_proc_exit) def _gpg_proc_exit(self, gpg_proc):