summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2014-09-26 19:36:01 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-30 14:10:34 +0100
commit3b92eb93ee9a3f9a86c067cb38ea83b28f0f2212 (patch)
treeff00c2f5289f5c4b1f884eaf26e39e427e81bbb9 /meta/lib
parentecf089785f676ff547f694288a48e3913c515fb1 (diff)
downloadpoky-3b92eb93ee9a3f9a86c067cb38ea83b28f0f2212.tar.gz
rootfs.py: catch inner warn message
Package managements (smart/apt-get/opkg-cl) generate some warn messages to stdout, and we need to catch them and output by bb.warn. Here is an example, while invoking smart to attempt install doc packages, if install failed, it generates warn message to stdout. ... |warning: Can't install util-linux-doc-2.24.2-r1@i586: Can't install util-linux-doc-2.24.2-r1@i586: no package provides info ... The fix catches it and outputs: ... |WARNING: log_check: There is a warn message in the logfile |WARNING: log_check: Matched keyword: [warn] |WARNING: log_check: warning: Can't install util-linux-doc-2.24.2-r1@ i586: Can't install util-linux-doc-2.24.2-r1@i586: no package provides info ... (From OE-Core rev: f8d725f49f2be4b854f523a5ee3a5c4357e67e30) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/rootfs.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 3d8ae81e6f..c4735f2755 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -347,7 +347,21 @@ class RpmRootfs(Rootfs):
347 # already saved in /etc/rpm-postinsts 347 # already saved in /etc/rpm-postinsts
348 pass 348 pass
349 349
350 def _log_check(self): 350 def _log_check_warn(self):
351 r = re.compile('(warn|Warn)')
352 log_path = self.d.expand("${T}/log.do_rootfs")
353 with open(log_path, 'r') as log:
354 for line in log.read().split('\n'):
355 if 'log_check' in line:
356 continue
357
358 m = r.search(line)
359 if m:
360 bb.warn('log_check: There is a warn message in the logfile')
361 bb.warn('log_check: Matched keyword: [%s]' % m.group())
362 bb.warn('log_check: %s\n' % line)
363
364 def _log_check_error(self):
351 r = re.compile('(unpacking of archive failed|Cannot find package|exit 1|ERR|Fail)') 365 r = re.compile('(unpacking of archive failed|Cannot find package|exit 1|ERR|Fail)')
352 log_path = self.d.expand("${T}/log.do_rootfs") 366 log_path = self.d.expand("${T}/log.do_rootfs")
353 with open(log_path, 'r') as log: 367 with open(log_path, 'r') as log:
@@ -370,6 +384,10 @@ class RpmRootfs(Rootfs):
370 if found_error == 6: 384 if found_error == 6:
371 bb.fatal(message) 385 bb.fatal(message)
372 386
387 def _log_check(self):
388 self._log_check_warn()
389 self._log_check_error()
390
373 def _handle_intercept_failure(self, registered_pkgs): 391 def _handle_intercept_failure(self, registered_pkgs):
374 rpm_postinsts_dir = self.image_rootfs + self.d.expand('${sysconfdir}/rpm-postinsts/') 392 rpm_postinsts_dir = self.image_rootfs + self.d.expand('${sysconfdir}/rpm-postinsts/')
375 bb.utils.mkdirhier(rpm_postinsts_dir) 393 bb.utils.mkdirhier(rpm_postinsts_dir)