uninative.bbclass: capture stdout/err from patchelf-uninative

When patchelf-uninative fails, reporting only the exit code
as done by subprocess.check_call() is not enough to understand
the problem. We also need to capture and report the output
of the command.

(From OE-Core rev: 87e744791e59806d0c87b37d72ff32a96bbcb929)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Patrick Ohly 2016-02-11 07:59:42 +01:00 committed by Richard Purdie
parent 906522260b
commit c38f25377b
1 changed files with 7 additions and 1 deletions

View File

@ -84,5 +84,11 @@ python uninative_changeinterp () {
continue
#bb.warn("patchelf-uninative --set-interpreter %s %s" % (d.getVar("UNINATIVE_LOADER", True), f))
subprocess.check_call("patchelf-uninative --set-interpreter %s %s" % (d.getVar("UNINATIVE_LOADER", True), f), shell=True)
cmd = "patchelf-uninative --set-interpreter %s %s" % (d.getVar("UNINATIVE_LOADER", True), f)
p = subprocess.Popen(cmd, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, stderr = p.communicate()
if p.returncode:
bb.fatal("'%s' failed with exit code %d and the following output:\n%s" %
(cmd, p.returncode, stdout))
}