bitbake: data_smart: Fix an unusual variable reference bug
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 May 2014 14:29:40 +0000 (15:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 May 2014 15:47:01 +0000 (16:47 +0100)
commit12db3c7fb162a000b281895697ae38fd2bc37703
tree42fcd8fbeac061e5ae25c840b49986402750b1d0
parentd26fdd16b061e2cacc7b488b8bb67768bde5159c
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 <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/data_smart.py
bitbake/lib/bb/tests/data.py