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()
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:
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