[oe-commits] Richard Purdie : lib/oe/package: Improve strip subprocess handling

git at git.openembedded.org git at git.openembedded.org
Tue Apr 28 16:55:22 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 3b6f5b6d53a325f921ec3da3c2fe54f9aaeeed59
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=3b6f5b6d53a325f921ec3da3c2fe54f9aaeeed59

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Tue Apr 28 17:09:58 2015 +0100

lib/oe/package: Improve strip subprocess handling

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 at linuxfoundation.org>

---

 meta/lib/oe/package.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index ea6feaa..f176446 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -33,14 +33,14 @@ def runstrip(arg):
     stripcmd = "'%s' %s '%s'" % (strip, extraflags, 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
 
 



More information about the Openembedded-commits mailing list