From 07ebf7f60f44c398a33101f35e04bb9004076d58 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 22 Jul 2008 03:58:53 +0000 Subject: Redirect build log eqawarn messages to the log file when in background mode. svn path=/main/trunk/; revision=11164 --- pym/_emerge/__init__.py | 12 +++++++++++- pym/portage/__init__.py | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 9bbd89dd2..36bf4a10c 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2736,7 +2736,17 @@ class EbuildPhase(CompositeTask): def _ebuild_exit(self, ebuild_process): if self.phase == "install": - portage._check_build_log(self.settings) + out = None + log_path = self.settings.get("PORTAGE_LOG_FILE") + log_file = None + if self.background and log_path is not None: + log_file = open(log_path, 'a') + out = log_file + try: + portage._check_build_log(self.settings, out=out) + finally: + if log_file is not None: + log_file.close() if self._default_exit(ebuild_process) != os.EX_OK: self.wait() diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 71fa0c6d5..66e3377ac 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -4292,7 +4292,7 @@ def _post_src_install_checks(mysettings): noiselevel=-1) return retval -def _check_build_log(mysettings): +def _check_build_log(mysettings, out=None): """ Search the content of $PORTAGE_LOG_FILE if it exists and generate the following QA Notices when appropriate: @@ -4337,7 +4337,7 @@ def _check_build_log(mysettings): from portage.elog.messages import eqawarn def _eqawarn(lines): for line in lines: - eqawarn(line, phase="install", key=mysettings.mycpv) + eqawarn(line, phase="install", key=mysettings.mycpv, out=out) from textwrap import wrap wrap_width = 70 -- cgit v1.2.3-1-g7c22