Redirect build log eqawarn messages to the log file when in background mode.
authorZac Medico <zmedico@gentoo.org>
Tue, 22 Jul 2008 03:58:53 +0000 (03:58 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 22 Jul 2008 03:58:53 +0000 (03:58 -0000)
svn path=/main/trunk/; revision=11164

pym/_emerge/__init__.py
pym/portage/__init__.py

index 9bbd89dd2b8ad5d3e826de5d574f8e9879020753..36bf4a10c591e3c4b0639de0a3bd48a956882107 100644 (file)
@@ -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()
index 71fa0c6d5abe8dd68788bd936bae4a07bcc339fd..66e3377acaea4493112b26d5e59aec18bdb74eba 100644 (file)
@@ -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