[bitbake-devel] [PATCH 1/6] bb/ui/hob: fix detection of whether GPLv3 is disabled

Joshua Lock josh at linux.intel.com
Thu Aug 4 01:23:17 UTC 2011


Find returns -1 if the substring isn't found, so checking for the
Truthiness of the return value is insufficient. An INCOMPATIBLE_LICENSE
value which only includes GPLv3 will cause find to return 0, for example.

Fixes [YOCTO #1320]

Signed-off-by: Joshua Lock <josh at linux.intel.com>
---
 lib/bb/ui/hob.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index a770fc2..5998e6b 100644
--- a/lib/bb/ui/hob.py
+++ b/lib/bb/ui/hob.py
@@ -954,7 +954,7 @@ def main (server, eventHandler):
 
     incompatible = server.runCommand(["getVariable", "INCOMPATIBLE_LICENSE"])
     gplv3disabled = False
-    if incompatible and incompatible.lower().find("gplv3"):
+    if incompatible and incompatible.lower().find("gplv3") != -1:
         gplv3disabled = True
 
     build_toolchain = bool(server.runCommand(["getVariable", "HOB_BUILD_TOOLCHAIN"]))
-- 
1.7.6





More information about the bitbake-devel mailing list