All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] data_smart: Ensure _remove operations on newly set variables are cleared
@ 2017-04-11 13:10 Richard Purdie
  2017-04-11 13:32 ` ✗ patchtest: failure for " Patchwork
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2017-04-11 13:10 UTC (permalink / raw)
  To: openembedded-core

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@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):
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* ✗ patchtest: failure for data_smart: Ensure _remove operations on newly set variables are cleared
  2017-04-11 13:10 [PATCH] data_smart: Ensure _remove operations on newly set variables are cleared Richard Purdie
@ 2017-04-11 13:32 ` Patchwork
  0 siblings, 0 replies; 3+ messages in thread
From: Patchwork @ 2017-04-11 13:32 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

== Series Details ==

Series: data_smart: Ensure _remove operations on newly set variables are cleared
Revision: 1
URL   : https://patchwork.openembedded.org/series/6295/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at ec2931852b)

* Issue             Series sent to the wrong mailing list [test_target_mailing_list] 
  Suggested fix    Send the series again to the correct mailing list (ML)
  Suggested ML     bitbake-devel@lists.openembedded.org [http://git.openembedded.org/bitbake/]



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] data_smart: Ensure _remove operations on newly set variables are cleared
@ 2017-04-11 14:09 Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2017-04-11 14:09 UTC (permalink / raw)
  To: bitbake-devel

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@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):
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-11 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-11 13:10 [PATCH] data_smart: Ensure _remove operations on newly set variables are cleared Richard Purdie
2017-04-11 13:32 ` ✗ patchtest: failure for " Patchwork
2017-04-11 14:09 [PATCH] " Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.