]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_ipk: Improve failure debug output
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 21 Jan 2017 14:11:52 +0000 (14:11 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 22 Jan 2017 09:05:04 +0000 (09:05 +0000)
Currently if the dpkg-deb command fails you see an error message like this:

ERROR: nss-3.27.1-r0 do_package_write_ipk: opkg-build execution failed
ERROR: nss-3.27.1-r0 do_package_write_ipk: Function failed: do_package_ipk

which is pretty much useless. If we use subprocess.check_output, we see a
traceback and then:

Exception: subprocess.CalledProcessError: Command '<cmd>' returned non-zero exit status 1

Subprocess output:
<output>

which is much easier to debug from.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package_ipk.bbclass

index 039b6ab69be9c6cfe5c41cdffdb091a9cb2468c2..9fb128b82b32135fc46ff442dec8e20dd23eab9a 100644 (file)
@@ -244,11 +244,8 @@ python do_package_ipk () {
             conffiles.close()
 
         os.chdir(basedir)
-        ret = subprocess.call("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH"),
+        subprocess.check_output("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH"),
                                                           d.getVar("OPKGBUILDCMD"), pkg, pkgoutdir), shell=True)
-        if ret != 0:
-            bb.utils.unlockfile(lf)
-            bb.fatal("opkg-build execution failed")
 
         if d.getVar('IPK_SIGN_PACKAGES') == '1':
             ipkver = "%s-%s" % (d.getVar('PKGV'), d.getVar('PKGR'))