]> code.ossystems Code Review - openembedded-core.git/commitdiff
rootfs.py: Make set -x not break rootfs creation
authorPeter Seebach <peter.seebach@windriver.com>
Thu, 21 May 2015 20:36:35 +0000 (15:36 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 28 Jun 2015 08:41:56 +0000 (09:41 +0100)
The rootfs logfile check errors out if it finds an "exit 1" in
a log. But consider the shell idiom:
if ! $command; then exit 1; fi
and consider a postinstall script with a "set -x" for debugging
purposes (to get log output in /var/log/postinstall.log.)

Solution: Ignore lines prefixed with a +, because those show shell
code even if a specific fragment won't be executed.

(From OE-Core rev: f23f129dba66144abf8fe8450320e01fa4c02f5c)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/rootfs.py

index ce23b237dc951aa1eea3a9ec2dafdd555f37f4db..a9a6c85a2cefd670ae7c7ca696e65bd677c777df 100644 (file)
@@ -403,6 +403,9 @@ class RpmRootfs(Rootfs):
             for line in log.read().split('\n'):
                 if 'log_check' in line:
                     continue
+                # sh -x may emit code which isn't actually executed
+                if line.startswith('+'):
+                   continue
 
                 m = r.search(line)
                 if m: