diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-02 16:33:54 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-04 10:38:43 +0100 |
commit | 92d8bd0eb5f7fc14c7e77d7f8e09f94929a15337 (patch) | |
tree | b889dfe3db18141ed67e73a3264e955b3196004a /bitbake/lib/bb/tests/data.py | |
parent | 70137f689f6c1909e327832f1c41b75dddd55c5a (diff) | |
download | poky-92d8bd0eb5f7fc14c7e77d7f8e09f94929a15337.tar.gz |
bitbake: data_smart: Fix inactive overide accidental variable value corruption
Setting something like:
BAR:append:unusedoverride
should cause BAR to be None, not "" which was what the datastore was
returning. This caused problems when mixing variables like:
RDEPENDS:${PN}:inactiveoverride
RDEPENDS:${BPN}
since key expansion would report key overlap when there was none. This
is a bug in the datastore. Fix it and add a test too.
[YOCTO #14088]
(Bitbake rev: 699e36c270d863258502d315ed00a1b940bfbf96)
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.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py index 7f1d3ffbbc..e667c7c7d3 100644 --- a/bitbake/lib/bb/tests/data.py +++ b/bitbake/lib/bb/tests/data.py | |||
@@ -405,6 +405,11 @@ class TestOverrides(unittest.TestCase): | |||
405 | bb.data.expandKeys(self.d) | 405 | bb.data.expandKeys(self.d) |
406 | self.assertEqual(self.d.getVar("VERSION"), "2") | 406 | self.assertEqual(self.d.getVar("VERSION"), "2") |
407 | 407 | ||
408 | def test_append_and_unused_override(self): | ||
409 | # Had a bug where an unused override append could return "" instead of None | ||
410 | self.d.setVar("BAR:append:unusedoverride", "testvalue2") | ||
411 | self.assertEqual(self.d.getVar("BAR"), None) | ||
412 | |||
408 | class TestKeyExpansion(unittest.TestCase): | 413 | class TestKeyExpansion(unittest.TestCase): |
409 | def setUp(self): | 414 | def setUp(self): |
410 | self.d = bb.data.init() | 415 | self.d = bb.data.init() |