summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-11 14:01:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-12 15:09:58 +0100
commit000b7d3d1c6ca934e5e988f8c6682a996c82b587 (patch)
treec7b4327b4ddb45848224dd8265d7b6ffbce42e01 /bitbake
parent64a379b3255929864164eb2a7fe792faf07c06ad (diff)
downloadpoky-000b7d3d1c6ca934e5e988f8c6682a996c82b587.tar.gz
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>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/data_smart.py2
-rw-r--r--bitbake/lib/bb/tests/data.py6
2 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index d6dd698eff..7dc1c68709 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -546,6 +546,8 @@ class DataSmart(MutableMapping):
546 del self.dict[var]["_append"] 546 del self.dict[var]["_append"]
547 if "_prepend" in self.dict[var]: 547 if "_prepend" in self.dict[var]:
548 del self.dict[var]["_prepend"] 548 del self.dict[var]["_prepend"]
549 if "_remove" in self.dict[var]:
550 del self.dict[var]["_remove"]
549 if var in self.overridedata: 551 if var in self.overridedata:
550 active = [] 552 active = []
551 self.need_overrides() 553 self.need_overrides()
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index fe947f5ba7..a4a9dd30fb 100644
--- a/bitbake/lib/bb/tests/data.py
+++ b/bitbake/lib/bb/tests/data.py
@@ -283,6 +283,12 @@ class TestConcatOverride(unittest.TestCase):
283 self.d.setVar("TEST_remove", "val") 283 self.d.setVar("TEST_remove", "val")
284 self.assertEqual(self.d.getVar("TEST"), "bar") 284 self.assertEqual(self.d.getVar("TEST"), "bar")
285 285
286 def test_remove_cleared(self):
287 self.d.setVar("TEST", "${VAL} ${BAR}")
288 self.d.setVar("TEST_remove", "val")
289 self.d.setVar("TEST", "${VAL} ${BAR}")
290 self.assertEqual(self.d.getVar("TEST"), "val bar")
291
286 # Ensure the value is unchanged if we have an inactive remove override 292 # Ensure the value is unchanged if we have an inactive remove override
287 # (including that whitespace is preserved) 293 # (including that whitespace is preserved)
288 def test_remove_inactive_override(self): 294 def test_remove_inactive_override(self):