* [PATCH] uboot-config.bbclass; Raise an error for unknown configs
@ 2013-10-10 18:15 Otavio Salvador
2013-10-11 8:18 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Otavio Salvador @ 2013-10-10 18:15 UTC (permalink / raw)
To: OpenEmbedded Core Mailing List; +Cc: Otavio Salvador
When passing the wrong value for UBOOT_CONFIG it ought to raise an
error otherwise it is quite difficult for user to notice it didn't
behave as expected.
Reported-by: Lauren Post <lauren.post@freescale.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/classes/uboot-config.bbclass | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
index ba01bff..ff226a1 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -51,4 +51,9 @@ python () {
if len(items) > 1 and items[1]:
bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
+
+ # Go out as we found a match!
+ break
+ else:
+ raise bb.parse.SkipPackage("UBOOT_CONFIG %s is not supported" % ubootconfig)
}
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] uboot-config.bbclass; Raise an error for unknown configs
2013-10-10 18:15 [PATCH] uboot-config.bbclass; Raise an error for unknown configs Otavio Salvador
@ 2013-10-11 8:18 ` Richard Purdie
2013-10-11 11:54 ` Otavio Salvador
0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2013-10-11 8:18 UTC (permalink / raw)
To: Otavio Salvador; +Cc: OpenEmbedded Core Mailing List
On Thu, 2013-10-10 at 15:15 -0300, Otavio Salvador wrote:
> When passing the wrong value for UBOOT_CONFIG it ought to raise an
> error otherwise it is quite difficult for user to notice it didn't
> behave as expected.
>
> Reported-by: Lauren Post <lauren.post@freescale.com>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> meta/classes/uboot-config.bbclass | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
> index ba01bff..ff226a1 100644
> --- a/meta/classes/uboot-config.bbclass
> +++ b/meta/classes/uboot-config.bbclass
> @@ -51,4 +51,9 @@ python () {
> if len(items) > 1 and items[1]:
> bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
> d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
> +
> + # Go out as we found a match!
> + break
> + else:
> + raise bb.parse.SkipPackage("UBOOT_CONFIG %s is not supported" % ubootconfig)
> }
Shouldn't this be an exception such as ValueError rather than
SkipPackage?
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] uboot-config.bbclass; Raise an error for unknown configs
2013-10-11 8:18 ` Richard Purdie
@ 2013-10-11 11:54 ` Otavio Salvador
0 siblings, 0 replies; 3+ messages in thread
From: Otavio Salvador @ 2013-10-11 11:54 UTC (permalink / raw)
To: Richard Purdie; +Cc: OpenEmbedded Core Mailing List
On Fri, Oct 11, 2013 at 5:18 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Thu, 2013-10-10 at 15:15 -0300, Otavio Salvador wrote:
>> When passing the wrong value for UBOOT_CONFIG it ought to raise an
>> error otherwise it is quite difficult for user to notice it didn't
>> behave as expected.
>>
>> Reported-by: Lauren Post <lauren.post@freescale.com>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>> meta/classes/uboot-config.bbclass | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
>> index ba01bff..ff226a1 100644
>> --- a/meta/classes/uboot-config.bbclass
>> +++ b/meta/classes/uboot-config.bbclass
>> @@ -51,4 +51,9 @@ python () {
>> if len(items) > 1 and items[1]:
>> bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
>> d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
>> +
>> + # Go out as we found a match!
>> + break
>> + else:
>> + raise bb.parse.SkipPackage("UBOOT_CONFIG %s is not supported" % ubootconfig)
>> }
>
> Shouldn't this be an exception such as ValueError rather than
> SkipPackage?
Good point; I will send a v2 fixing this.
Thanks for reviewing it.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-11 11:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-10 18:15 [PATCH] uboot-config.bbclass; Raise an error for unknown configs Otavio Salvador
2013-10-11 8:18 ` Richard Purdie
2013-10-11 11:54 ` Otavio Salvador
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.