bitbake.conf: fix suspicious comparison with ('' or 'custom')
PATCH 1/1 bitbake.conf: fix suspicious comparison with ('' or 'custom')
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.
---
meta/conf/bitbake.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/conf/bitbake.conf +2 -2
@@ -129,7 +129,7 @@ SDKUSE_NLS ??= "yes" TARGET_ARCH = "${TUNE_ARCH}" TARGET_OS = "linux${LIBCEXTENSION}${ABIEXTENSION}" TARGET_VENDOR = "-oe" -TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + d.getVar('TARGET_OS'), ''][d.getVar('TARGET_OS') == ('' or 'custom')]}" +TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + d.getVar('TARGET_OS'), ''][d.getVar('TARGET_OS') in ('', 'custom')]}" TARGET_PREFIX = "${TARGET_SYS}-" TARGET_CC_ARCH = "${TUNE_CCARGS}" TARGET_LD_ARCH = "${TUNE_LDARGS}"
@@ -138,7 +138,7 @@ TARGET_AS_ARCH = "${TUNE_ASARGS}" SDKMACHINE ??= "x86_64" SDK_OS = "${BUILD_OS}" SDK_VENDOR = "-oesdk" -SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS'), ''][d.getVar('SDK_OS') == ('' or 'custom')]}" +SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS'), ''][d.getVar('SDK_OS') in ('', 'custom')]}" SDK_PREFIX = "${SDK_SYS}-" SDK_CC_ARCH = "${BUILD_CC_ARCH}" SDKPKGSUFFIX = "nativesdk"
Signature · 1 line
2.17.1
Quoted 14 lines · Masahiro Yamada
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_OSis empty or 'custom', the correct code would be:d.getVar('TARGET_OS', d, 1) == '' or d.getVar('TARGET_OS', d, 1) == 'custom'
Quoted 8 lines
Or, more simply:
d.getVar('TARGET_OS', d, 1) in ('', 'custom')I guess this is probably the intended behavior.
Signed-off-by Masahiro Yamada <[email protected]>---
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