summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/data.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:47:01 +0100
commit122079e9b0b513c46ca76993403db4cfa51e858f (patch)
treeb8dd731a037b651be2103870e5a99922cca17973 /bitbake/lib/bb/tests/data.py
parentbf9ff3de5f24ffabbf7093f0664730f22d31f191 (diff)
downloadopenembedded-core-contrib-122079e9b0b513c46ca76993403db4cfa51e858f.tar.gz
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>
Diffstat (limited to 'bitbake/lib/bb/tests/data.py')
-rw-r--r--bitbake/lib/bb/tests/data.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index ee66b22e25..228f72c1f5 100644
--- a/bitbake/lib/bb/tests/data.py
+++ b/bitbake/lib/bb/tests/data.py
@@ -253,6 +253,11 @@ class TestConcatOverride(unittest.TestCase):
bb.data.update_data(self.d)
self.assertEqual(self.d.getVar("TEST_TEST", True), "bar bar")
+ def test_empty_remove(self):
+ self.d.setVar("TEST", "")
+ self.d.setVar("TEST_remove", "val")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "")
class TestOverrides(unittest.TestCase):
def setUp(self):