All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] package_ipk.bbclass: print opkg output on error
@ 2020-05-19 18:36 Konrad Weihmann
  2020-05-19 22:02 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 10+ messages in thread
From: Konrad Weihmann @ 2020-05-19 18:36 UTC (permalink / raw)
  To: openembedded-core; +Cc: Konrad Weihmann

in case the opkg command fails in before no output of the tool
itself was printed to assist the user with debugging the issue.
Print all output of the tool by using CalledProcessError wrapper around
the call

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
---
 meta/classes/package_ipk.bbclass | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index c008559e4a..5e7d552cc5 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -223,10 +223,13 @@ 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)
+        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 exp:
+            bb.fatal("{} failed with {}: {}".format(exp.cmd, exp.returncode, exp.output.decode("utf-8")))
 
         if d.getVar('IPK_SIGN_PACKAGES') == '1':
             ipkver = "%s-%s" % (d.getVar('PKGV'), d.getVar('PKGR'))
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-21 13:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 18:36 [PATCH] package_ipk.bbclass: print opkg output on error Konrad Weihmann
2020-05-19 22:02 ` [OE-core] " Richard Purdie
2020-05-19 22:13   ` Denys Dmytriyenko
2020-05-19 22:14   ` Khem Raj
2020-05-20  5:07     ` Konrad Weihmann
2020-05-20  5:34       ` Khem Raj
2020-05-20 20:17   ` Konrad Weihmann
2020-05-20 21:28     ` Khem Raj
2020-05-21 13:24     ` Richard Purdie
2020-05-21 13:48       ` Konrad Weihmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.