From eb3607540a3b88ec2148e84d87edd487901e4b9b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 14 Oct 2010 19:55:44 -0700 Subject: [PATCH] Fix parallel-fetch output by BinpkgVerifier. BinpkgVerifier was erroneusly sending parallel-fetch output to stdout. Thanks to Jeremy Olexa for reporting. --- pym/_emerge/BinpkgVerifier.py | 3 ++- pym/_emerge/PollScheduler.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/BinpkgVerifier.py b/pym/_emerge/BinpkgVerifier.py index ed4fc1f74..e787437d0 100644 --- a/pym/_emerge/BinpkgVerifier.py +++ b/pym/_emerge/BinpkgVerifier.py @@ -71,7 +71,8 @@ class BinpkgVerifier(AsynchronousTask): msg = _unicode_decode(out.getvalue(), encoding=_encodings['content'], errors='replace') if msg: - self.scheduler.output(msg, log_path=self.logfile) + self.scheduler.output(msg, log_path=self.logfile, + background=self.background) self.returncode = rval self.wait() diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py index f9fe32e9a..68826e28e 100644 --- a/pym/_emerge/PollScheduler.py +++ b/pym/_emerge/PollScheduler.py @@ -244,7 +244,8 @@ class PollScheduler(object): return event_handled - def _task_output(self, msg, log_path=None, level=0, noiselevel=-1): + def _task_output(self, msg, log_path=None, background=None, + level=0, noiselevel=-1): """ Output msg to stdout if not self._background. If log_path is not None then append msg to the log (appends with @@ -252,7 +253,12 @@ class PollScheduler(object): corresponds to a supported compression type). """ - if not self._background: + if background is None: + # If the task does not have a local background value + # (like for parallel-fetch), then use the global value. + background = self._background + + if not background: writemsg_level(msg, level=level, noiselevel=noiselevel) if log_path is not None: -- 2.26.2