]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_deb: Improve failure debug output
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 21 Jan 2017 13:55:36 +0000 (13:55 +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_deb: dpkg-deb execution failed
ERROR: nss-3.27.1-r0 do_package_write_deb: Function failed: do_package_deb

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_deb.bbclass

index 6ce008f1ac59daecf58f95eb046b938f778f680a..2a70b50c9f3a5f8596778022cf7facc52c01b103 100644 (file)
@@ -308,10 +308,7 @@ python do_package_deb () {
             conffiles.close()
 
         os.chdir(basedir)
-        ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH"), root, pkgoutdir), shell=True)
-        if ret != 0:
-            bb.utils.unlockfile(lf)
-            bb.fatal("dpkg-deb execution failed")
+        subprocess.check_output("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH"), root, pkgoutdir), shell=True)
 
         cleanupcontrol(root)
         bb.utils.unlockfile(lf)