All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/oe/package: Improve strip subprocess handling
@ 2015-04-28 16:09 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2015-04-28 16:09 UTC (permalink / raw)
  To: openembedded-core

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>

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
 
 




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-28 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-28 16:09 [PATCH] lib/oe/package: Improve strip subprocess handling Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.