Re: [OE-core] [PATCH] uboot-config.bbclass: Raise error for bad key

2022-07-28 Thread Otavio Salvador
Em qui., 28 de jul. de 2022 às 15:44, Tom Hochstein 
escreveu:

> If an invalid key is used, the class ignores the error, with an
> indeterminate result. In my case, the problem surfaced in do_deploy:
>
> ```
> | cp: cannot stat
> '/.../build/tmp/work/imx6qdlsabresd-fsl-linux-gnueabi/u-boot-imx-mfgtool/2022.04-r0/deploy-u-boot-imx-mfgtool/u-boot.imx':
> No such file or
> | directory
> ```
>
> The root cause of this was that the uboot config key did not match
> a valid option. With the fix, the error is caught by the class:
>
> ```
> ERROR: Nothing PROVIDES 'u-boot-imx-mfgtool'
> u-boot-imx-mfgtool was skipped: The selected UBOOT_CONFIG key ['mfgtool']
> has no match in dict_keys(['sd-fslc', 'sd-imx', 'sd-optee-imx', 'sata-imx',
> 'mfgtool-imx']).
> ```
>
> Signed-off-by: Tom Hochstein 
>

Acked-by: Otavio Salvador 

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854  Mobile: +1 (347) 903-9750

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168616): 
https://lists.openembedded.org/g/openembedded-core/message/168616
Mute This Topic: https://lists.openembedded.org/mt/92676883/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] uboot-config.bbclass: Raise error for bad key

2022-07-28 Thread Tom Hochstein
If an invalid key is used, the class ignores the error, with an
indeterminate result. In my case, the problem surfaced in do_deploy:

```
| cp: cannot stat 
'/.../build/tmp/work/imx6qdlsabresd-fsl-linux-gnueabi/u-boot-imx-mfgtool/2022.04-r0/deploy-u-boot-imx-mfgtool/u-boot.imx':
 No such file or
| directory
```

The root cause of this was that the uboot config key did not match
a valid option. With the fix, the error is caught by the class:

```
ERROR: Nothing PROVIDES 'u-boot-imx-mfgtool'
u-boot-imx-mfgtool was skipped: The selected UBOOT_CONFIG key ['mfgtool'] has 
no match in dict_keys(['sd-fslc', 'sd-imx', 'sd-optee-imx', 'sata-imx', 
'mfgtool-imx']).
```

Signed-off-by: Tom Hochstein 
---
 meta/classes/uboot-config.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/uboot-config.bbclass 
b/meta/classes/uboot-config.bbclass
index b9ad35821a..e8da8c7452 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -125,5 +125,6 @@ python () {
 else:
 bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % 
ubootbinary)
 d.appendVar('UBOOT_BINARIES', ' ' + ubootbinary)
-break
+return
+raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no 
match in %s." % (ubootconfig, ubootconfigflags.keys()))
 }
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168614): 
https://lists.openembedded.org/g/openembedded-core/message/168614
Mute This Topic: https://lists.openembedded.org/mt/92676883/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-