Skip to contentSkip to conversation

Fixes wrong comparison

PATCH New Imran Mehmood 1 participant 1 message Feb 15, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixes wrong comparison

The expression ('' or 'custom') will always result in 'custom' so the expression will become False when the variable (TARGET_OS, SDK_OS) is '' while its expected to be True in this case also.

---
 conf/bitbake.conf |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
conf/bitbake.conf +2 -2
index 1baecc1..de740bb 100644
@@ -111,7 +111,7 @@ HOST_EXEEXT = ""
 TARGET_ARCH ?= "INVALID"
 TARGET_OS = "INVALID"
 TARGET_VENDOR = "${BUILD_VENDOR}"
-TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + bb.data.getVar('TARGET_OS', d, 1), ''][bb.data.getVar('TARGET_OS', d, 1) == ('' or 'custom')]}"
+TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + bb.data.getVar('TARGET_OS', d, 1), ''][bb.data.getVar('TARGET_OS', d, 1) in ('', 'custom')]}"
 TARGET_PREFIX = "${TARGET_SYS}-"
 TARGET_CC_ARCH = ""
 TARGET_EXEEXT = ""
@@ -119,7 +119,7 @@ TARGET_EXEEXT = ""
 SDK_ARCH ?= "${BUILD_ARCH}"
 SDK_OS ?= "${BUILD_OS}"
 SDK_VENDOR ?= "${BUILD_VENDOR}"
-SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + bb.data.getVar('SDK_OS', d, 1), ''][bb.data.getVar('SDK_OS', d, 1) == ('' or 'custom')]}"
+SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + bb.data.getVar('SDK_OS', d, 1), ''][bb.data.getVar('SDK_OS', d, 1) in ('', 'custom')]}"
 SDK_PREFIX = "${SDK_SYS}-"
 SDK_CC_ARCH ?= "${BUILD_CC_ARCH}"
 SDK_EXEEXT = ""
Signature · 1 line
1.6.3.3