From f254a3a8135e9b32ae931dffdc36c4fbfe813cc3 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 7 Jan 2013 17:48:11 -0800 Subject: [PATCH] ManifestTask: use PipeLogger for monitoring --- .../package/ebuild/_parallel_manifest/ManifestTask.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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): -- 2.26.2