From 122079e9b0b513c46ca76993403db4cfa51e858f Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 21 May 2014 15:29:40 +0100 Subject: bitbake: 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. (Bitbake rev: af3ce0fc0280e6642fa35de400f75fdbabf329b1) Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bitbake/lib/bb/data_smart.py') diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 46a0221e10..707029de93 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/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) -- cgit v1.2.3-54-g00ecf