All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] package_ipk: handle exception for subprocess command
@ 2019-03-28  9:46 Andrey Zhizhikin
  2019-04-14 14:21 ` Andrey Zhizhikin
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Zhizhikin @ 2019-03-28  9:46 UTC (permalink / raw)
  To: openembedded-core

When opkg-build command fails to execute, subprocess is returned with
exception instead of printing to stderr. This causes the error logging
not to be printed out, as the "finally" statement does not contain any
bitbake error output.

One example of this behavior is when the package name contains uppercase
character, which are rejected by opkg-build, subprocess.check_output
would except and no error log would be produced.

This commit catches the exception subprocess.CalledProcessError and
produces bb.error output visible to the user.

Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
---
 meta/classes/package_ipk.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index d1b317b42b..f181f5b4fd 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -234,6 +234,8 @@ def ipk_write_pkg(pkg, d):
             ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, d.getVar('PACKAGE_ARCH'))
             sign_ipk(d, ipk_to_sign)
 
+    except subprocess.CalledProcessError as exc:
+        bb.error("OPKG Build failed: %s" % exc.output)
     finally:
         cleanupcontrol(root)
         bb.utils.unlockfile(lf)
-- 
2.17.1



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

end of thread, other threads:[~2019-04-25 14:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-28  9:46 [PATCH] package_ipk: handle exception for subprocess command Andrey Zhizhikin
2019-04-14 14:21 ` Andrey Zhizhikin
2019-04-15 16:45   ` Richard Purdie
2019-04-16  7:10     ` Andrey Zhizhikin
2019-04-16  8:24       ` richard.purdie
2019-04-16  9:12         ` Andrey Zhizhikin
2019-04-25 13:09           ` Andrey Zhizhikin
2019-04-25 13:41           ` richard.purdie
2019-04-25 14:51             ` Andrey Zhizhikin
2019-04-25 14:55               ` Andrey Zhizhikin

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.