]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: data: Clean up expandKeys None value handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 May 2015 10:41:02 +0000 (11:41 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 29 May 2015 09:17:16 +0000 (10:17 +0100)
This comparison is interesting even in the case of empty vales. Enabling
this warning actually found a bug in the metadata in avahi. Make the
code handle None specifically and also remove the dead code path in the
second if statement.

(Bitbake rev: a4cd4c56284812efb2a2bc0c8667ddad073f8e94)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/data.py

index 218998a0af0cb5ac2000379e78d27b9bba364d2c..f8dc976a1c8f0972c2dab93778e1acf020cf01f4 100644 (file)
@@ -157,9 +157,9 @@ def expandKeys(alterdata, readdata = None):
             continue
         todolist[key] = ekey
         newval = alterdata.getVar(ekey, 0)
-        if newval:
+        if newval is not None:
             val = alterdata.getVar(key, 0)
-            if val is not None and newval is not None:
+            if val is not None:
                 bb.warn("Variable key %s (%s) replaces original key %s (%s)." % (key, val, ekey, newval))
 
     # These two for loops are split for performance to maximise the