bitbake: data_smart: Ensure _remove operations on newly set variables are cleared
We clear append/prepend on newly set variables, we should also clear remove operations. If we don't do this, there is no way we can actually delete a remove operation. Bitbake internally uses parsing=True to avoid these side effects when making its own internal calls. Also add a testcase to bitbake-selftest to ensure we remain consistent going forward from here. (Bitbake rev: 3a319f079d699c870d8531e051ab65e6278d1fa5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
64a379b325
commit
000b7d3d1c
|
@ -546,6 +546,8 @@ class DataSmart(MutableMapping):
|
||||||
del self.dict[var]["_append"]
|
del self.dict[var]["_append"]
|
||||||
if "_prepend" in self.dict[var]:
|
if "_prepend" in self.dict[var]:
|
||||||
del self.dict[var]["_prepend"]
|
del self.dict[var]["_prepend"]
|
||||||
|
if "_remove" in self.dict[var]:
|
||||||
|
del self.dict[var]["_remove"]
|
||||||
if var in self.overridedata:
|
if var in self.overridedata:
|
||||||
active = []
|
active = []
|
||||||
self.need_overrides()
|
self.need_overrides()
|
||||||
|
|
|
@ -283,6 +283,12 @@ class TestConcatOverride(unittest.TestCase):
|
||||||
self.d.setVar("TEST_remove", "val")
|
self.d.setVar("TEST_remove", "val")
|
||||||
self.assertEqual(self.d.getVar("TEST"), "bar")
|
self.assertEqual(self.d.getVar("TEST"), "bar")
|
||||||
|
|
||||||
|
def test_remove_cleared(self):
|
||||||
|
self.d.setVar("TEST", "${VAL} ${BAR}")
|
||||||
|
self.d.setVar("TEST_remove", "val")
|
||||||
|
self.d.setVar("TEST", "${VAL} ${BAR}")
|
||||||
|
self.assertEqual(self.d.getVar("TEST"), "val bar")
|
||||||
|
|
||||||
# Ensure the value is unchanged if we have an inactive remove override
|
# Ensure the value is unchanged if we have an inactive remove override
|
||||||
# (including that whitespace is preserved)
|
# (including that whitespace is preserved)
|
||||||
def test_remove_inactive_override(self):
|
def test_remove_inactive_override(self):
|
||||||
|
|
Loading…
Reference in New Issue