[OE-core] [PATCH] ipk_write_pkg: add error output

Alejandro del Castillo alejandro.delcastillo at ni.com
Wed Jan 16 22:39:26 UTC 2019


Signed-off-by: Alejandro del Castillo <alejandro.delcastillo at ni.com>
---
 meta/classes/package_ipk.bbclass | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 508b7dcaff..5eec20a35b 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -224,15 +224,18 @@ def ipk_write_pkg(pkg, d):
             conffiles.close()
 
         os.chdir(basedir)
-        subprocess.check_output("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH"),
-                                                          d.getVar("OPKGBUILDCMD"), pkg, pkgoutdir),
-                                stderr=subprocess.STDOUT,
-                                shell=True)
-
-        if d.getVar('IPK_SIGN_PACKAGES') == '1':
-            ipkver = "%s-%s" % (d.getVar('PKGV'), d.getVar('PKGR'))
-            ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, d.getVar('PACKAGE_ARCH'))
-            sign_ipk(d, ipk_to_sign)
+        try:
+            subprocess.check_output("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH"),
+                                                              d.getVar("OPKGBUILDCMD"), pkg, pkgoutdir),
+                                    stderr=subprocess.STDOUT,
+                                    shell=True)
+        except subprocess.CalledProcessError as e:
+            bb.error("Failed to create package, opkg-build failed with: %s" % e.output.decode('utf-8'))
+        else:
+            if d.getVar('IPK_SIGN_PACKAGES') == '1':
+                ipkver = "%s-%s" % (d.getVar('PKGV'), d.getVar('PKGR'))
+                ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, d.getVar('PACKAGE_ARCH'))
+                sign_ipk(d, ipk_to_sign)
 
     finally:
         cleanupcontrol(root)
-- 
2.20.1



More information about the Openembedded-core mailing list