aboutsummaryrefslogtreecommitdiffstats
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-29 17:49:11 +0100
commitf8d725f49f2be4b854f523a5ee3a5c4357e67e30 (patch)
tree66b233402a85171e3e3c078b474787825a669ddb
parent8e4ab29924c8c5fe2a79e8b0ca41fa45cc8e94a1 (diff)
downloadopenembedded-core-contrib-f8d725f49f2be4b854f523a5ee3a5c4357e67e30.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 ... Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-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):
# already saved in /etc/rpm-postinsts
pass
- def _log_check(self):
+ def _log_check_warn(self):
+ r = re.compile('(warn|Warn)')
+ log_path = self.d.expand("${T}/log.do_rootfs")
+ with open(log_path, 'r') as log:
+ for line in log.read().split('\n'):
+ if 'log_check' in line:
+ continue
+
+ m = r.search(line)
+ if m:
+ bb.warn('log_check: There is a warn message in the logfile')
+ bb.warn('log_check: Matched keyword: [%s]' % m.group())
+ bb.warn('log_check: %s\n' % line)
+
+ def _log_check_error(self):
r = re.compile('(unpacking of archive failed|Cannot find package|exit 1|ERR|Fail)')
log_path = self.d.expand("${T}/log.do_rootfs")
with open(log_path, 'r') as log:
@@ -370,6 +384,10 @@ class RpmRootfs(Rootfs):
if found_error == 6:
bb.fatal(message)
+ def _log_check(self):
+ self._log_check_warn()
+ self._log_check_error()
+
def _handle_intercept_failure(self, registered_pkgs):
rpm_postinsts_dir = self.image_rootfs + self.d.expand('${sysconfdir}/rpm-postinsts/')
bb.utils.mkdirhier(rpm_postinsts_dir)