[bitbake-devel] [PATCH 2/2] data_smart: split expanded removal values when handling _remove

Ross Burton ross.burton at intel.com
Mon Feb 2 15:09:25 UTC 2015


Given these assignments:

 TEST="a b c d"
 TEST_remove = "b d"

TEST evaluates to "a c".  However, if the _remove override is given as a
variable:

 TEST="a b c d"
 FOO = "b d"
 TEST_remove = "${FOO}

TEST evaluates to "a b c d", because when FOO is expanded it isn't split into a
list.

Solve this by splitting all members of removeactive once they've been expanded.

[ YOCTO #7272 ]

Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 bitbake/lib/bb/data_smart.py |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index b1ea33f..7bb7b4a 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -621,7 +621,8 @@ class DataSmart(MutableMapping):
                 cachename = var + "[" + flag + "]"
             value = self.expand(value, cachename)
         if value and flag == "_content" and local_var is not None and "_removeactive" in local_var:
-            removes = [self.expand(r) for r in local_var["_removeactive"]]
+            removes = [self.expand(r).split()  for r in local_var["_removeactive"]]
+            removes = reduce(lambda a, b: a+b, removes, [])
             filtered = filter(lambda v: v not in removes,
                               value.split())
             value = " ".join(filtered)
-- 
1.7.10.4




More information about the bitbake-devel mailing list