All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Zhizhikin <andrey.z@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] package_ipk: handle exception for subprocess command
Date: Sun, 14 Apr 2019 16:21:00 +0200	[thread overview]
Message-ID: <CAHtQpK5ky=PfhuxTGaGkXTzxjevvQ9bD6yiTNkr9KwWL8buSRA@mail.gmail.com> (raw)
In-Reply-To: <20190328094652.19336-1-andrey.z@gmail.com>

Ping.

On Thu, Mar 28, 2019 at 10:47 AM Andrey Zhizhikin <andrey.z@gmail.com> wrote:
>
> 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
>


  reply	other threads:[~2019-04-14 14:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28  9:46 [PATCH] package_ipk: handle exception for subprocess command Andrey Zhizhikin
2019-04-14 14:21 ` Andrey Zhizhikin [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHtQpK5ky=PfhuxTGaGkXTzxjevvQ9bD6yiTNkr9KwWL8buSRA@mail.gmail.com' \
    --to=andrey.z@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.