diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2016-02-11 07:59:42 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-11 12:31:32 +0000 |
commit | 87e744791e59806d0c87b37d72ff32a96bbcb929 (patch) | |
tree | 09b10793d61190886de42b051ad10dd40f0f41e7 /meta/classes | |
parent | 24eba6f321e1152bcf60bc16ec21b0b29ab21179 (diff) | |
download | openembedded-core-87e744791e59806d0c87b37d72ff32a96bbcb929.tar.gz openembedded-core-87e744791e59806d0c87b37d72ff32a96bbcb929.tar.bz2 openembedded-core-87e744791e59806d0c87b37d72ff32a96bbcb929.zip |
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.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/uninative.bbclass | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass index 580917b119..0448cf6cdc 100644 --- a/meta/classes/uninative.bbclass +++ b/meta/classes/uninative.bbclass @@ -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)) } |