[OE-core] [PATCH] bitbake.conf: fix suspicious comparison with ('' or 'custom')
Richard Purdie
richard.purdie at linuxfoundation.org
Sat Dec 28 23:40:15 UTC 2019
On Sun, 2019-12-22 at 16:59 +0900, Masahiro Yamada wrote:
> I am not sure what is intended by the code:
>
> d.getVar('TARGET_OS', d, 1) == ('' or 'custom')
>
> This is equivalent to:
>
> d.getVar('TARGET_OS', d, 1) == 'custom'
>
> If the intended behavior is to take the second element of the array
> when TARGET_OS is empty or 'custom', the correct code would be:
>
> d.getVar('TARGET_OS', d, 1) == '' or
> d.getVar('TARGET_OS', d, 1) == 'custom'
>
> Or, more simply:
>
> d.getVar('TARGET_OS', d, 1) in ('', 'custom')
>
> I guess this is probably the intended behavior.
>
> Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>
> ---
Thanks for spotting this. Given this doesn't seem useful, I'm going to
test a patch going one step further and removing all this indirection.
I can't what use it has...
Cheers,
Richard
More information about the Openembedded-core
mailing list