]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/package: Improve strip subprocess handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 Apr 2015 16:09:58 +0000 (17:09 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 29 Apr 2015 09:39:41 +0000 (10:39 +0100)
Currently if the strip process fails, we get a message but don't know why. This adds
code to show the return value and any error output.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/package.py

index 8bc56c6e88eb138ed36774c8628934c4e8613cd3..947a97785a5574205c5fbf52a82d4fa446fd1ce5 100644 (file)
@@ -34,14 +34,14 @@ def runstrip(arg):
     stripcmd = "'%s' %s '%s' -o '%s.tmp' && chown --reference='%s' '%s.tmp' && mv '%s.tmp' '%s'" % (strip, extraflags, file, file, file, file, file, file)
     bb.debug(1, "runstrip: %s" % stripcmd)
 
-    ret = subprocess.call(stripcmd, shell=True)
+    try:
+        output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT, shell=True)
+    except subprocess.CalledProcessError as e:
+        bb.error("runstrip: '%s' strip command failed with %s (%s)" % (stripcmd, e.returncode, e.output))
 
     if newmode:
         os.chmod(file, origmode)
 
-    if ret:
-        bb.error("runstrip: '%s' strip command failed" % stripcmd)
-
     return