summaryrefslogtreecommitdiffstats
path: root/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-21 15:29:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-21 16:46:45 +0100
commitaf3ce0fc0280e6642fa35de400f75fdbabf329b1 (patch)
tree38054a28f113dbfb8167b332f435ac6010454962 /lib/bb/data_smart.py
parenta68a6dc50c11cc59e7c873414e3e22ac2644dea7 (diff)
downloadbitbake-contrib-af3ce0fc0280e6642fa35de400f75fdbabf329b1.tar.gz
data_smart: Fix an unusual variable reference bug
If you try: Y = "" Y_remove = "X" in OE-Core, bitbake will crash with a KeyError during expansion. The reason is that no expansion of the empty value is attempted but removal from is it and hence no varparse data is present for it in the expand_cache. If the value is empty, there is nothing to remove so the best fix is simply not to check for None but check it has any value. Also add a test for this error so it doesn't get reintroduced. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r--lib/bb/data_smart.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 46a0221e1..707029de9 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -615,7 +615,7 @@ class DataSmart(MutableMapping):
else:
cachename = var + "[" + flag + "]"
value = self.expand(value, cachename)
- if value is not None and flag == "_content" and local_var is not None and "_removeactive" in local_var:
+ if value and flag == "_content" and local_var is not None and "_removeactive" in local_var:
filtered = filter(lambda v: v not in local_var["_removeactive"],
value.split(" "))
value = " ".join(filtered)