summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-22 03:58:53 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-22 03:58:53 +0000
commit07ebf7f60f44c398a33101f35e04bb9004076d58 (patch)
treedb1423f063d105888a2539853fcb0eb9195a2b91
parent5f1caad49179cf13034e4e6583ad695ab2109931 (diff)
downloadportage-07ebf7f60f44c398a33101f35e04bb9004076d58.tar.gz
portage-07ebf7f60f44c398a33101f35e04bb9004076d58.tar.bz2
portage-07ebf7f60f44c398a33101f35e04bb9004076d58.zip
Redirect build log eqawarn messages to the log file when in background mode.
svn path=/main/trunk/; revision=11164
-rw-r--r--pym/_emerge/__init__.py12
-rw-r--r--pym/portage/__init__.py4
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