[oe-commits] [bitbake] branch master-next updated: data_smart: Ensure _remove operations on newly set variables are cleared
git at git.openembedded.org
git at git.openembedded.org
Tue Apr 11 15:46:19 UTC 2017
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
The following commit(s) were added to refs/heads/master-next by this push:
new 3a319f0 data_smart: Ensure _remove operations on newly set variables are cleared
3a319f0 is described below
commit 3a319f079d699c870d8531e051ab65e6278d1fa5
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Apr 11 14:01:50 2017 +0100
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.
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/data_smart.py | 2 ++
lib/bb/tests/data.py | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index d6dd698..7dc1c68 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -546,6 +546,8 @@ class DataSmart(MutableMapping):
del self.dict[var]["_append"]
if "_prepend" in self.dict[var]:
del self.dict[var]["_prepend"]
+ if "_remove" in self.dict[var]:
+ del self.dict[var]["_remove"]
if var in self.overridedata:
active = []
self.need_overrides()
diff --git a/lib/bb/tests/data.py b/lib/bb/tests/data.py
index fe947f5..a4a9dd3 100644
--- a/lib/bb/tests/data.py
+++ b/lib/bb/tests/data.py
@@ -283,6 +283,12 @@ class TestConcatOverride(unittest.TestCase):
self.d.setVar("TEST_remove", "val")
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
# (including that whitespace is preserved)
def test_remove_inactive_override(self):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list