All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] core/br2-external: properly report unexpected errors
@ 2017-01-28 10:41 Yann E. MORIN
  2017-03-26 21:44 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2017-01-28 10:41 UTC (permalink / raw)
  To: buildroot

Unextected error in the br2-external script are properly caught, but
they are not reported properly, and we end up in either of two
situations:

  - the .br2-external.mk file is not generated, in which case make will
    try to find a rule to generate it (because the 'include' directive
    tries to generate missing files);

  - the .br-external.mk file is generated but does not contain the error
    variable, and thus the build might not get interrupted.

We fix that by using a trap on the pseudo ERR signal, to emit the error
variable on unexpected errors.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 support/scripts/br2-external | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/support/scripts/br2-external b/support/scripts/br2-external
index 26bcac8..7e81608 100755
--- a/support/scripts/br2-external
+++ b/support/scripts/br2-external
@@ -40,6 +40,9 @@ main() {
 
     exec >"${ofile}"
 
+    # Trap any unexpected error to generate a meaningful error message
+    trap "error 'unexpected error while generating ${ofile}\n'" ERR
+
     do_validate ${@//:/ }
 
     do_${ofmt}
-- 
2.7.4

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

* [Buildroot] [PATCH] core/br2-external: properly report unexpected errors
  2017-01-28 10:41 [Buildroot] [PATCH] core/br2-external: properly report unexpected errors Yann E. MORIN
@ 2017-03-26 21:44 ` Thomas Petazzoni
  2017-03-31  7:10   ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2017-03-26 21:44 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 28 Jan 2017 11:41:32 +0100, Yann E. MORIN wrote:
> Unextected error in the br2-external script are properly caught, but
> they are not reported properly, and we end up in either of two
> situations:
> 
>   - the .br2-external.mk file is not generated, in which case make will
>     try to find a rule to generate it (because the 'include' directive
>     tries to generate missing files);
> 
>   - the .br-external.mk file is generated but does not contain the error
>     variable, and thus the build might not get interrupted.
> 
> We fix that by using a trap on the pseudo ERR signal, to emit the error
> variable on unexpected errors.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
>  support/scripts/br2-external | 3 +++
>  1 file changed, 3 insertions(+)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] core/br2-external: properly report unexpected errors
  2017-03-26 21:44 ` Thomas Petazzoni
@ 2017-03-31  7:10   ` Peter Korsgaard
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2017-03-31  7:10 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Hello,
 > On Sat, 28 Jan 2017 11:41:32 +0100, Yann E. MORIN wrote:
 >> Unextected error in the br2-external script are properly caught, but
 >> they are not reported properly, and we end up in either of two
 >> situations:
 >> 
 >> - the .br2-external.mk file is not generated, in which case make will
 >> try to find a rule to generate it (because the 'include' directive
 >> tries to generate missing files);
 >> 
 >> - the .br-external.mk file is generated but does not contain the error
 >> variable, and thus the build might not get interrupted.
 >> 
 >> We fix that by using a trap on the pseudo ERR signal, to emit the error
 >> variable on unexpected errors.
 >> 
 >> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 >> ---
 >> support/scripts/br2-external | 3 +++
 >> 1 file changed, 3 insertions(+)

Committed to 2017.02.x, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2017-03-31  7:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-28 10:41 [Buildroot] [PATCH] core/br2-external: properly report unexpected errors Yann E. MORIN
2017-03-26 21:44 ` Thomas Petazzoni
2017-03-31  7:10   ` Peter Korsgaard

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.