summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-16 17:15:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-18 10:59:27 +0100
commitf7f5e30667e1ad8e1ca76ee331be2843f2976bfa (patch)
tree2c865125c7a0a315a0f6e08470cf73ee38dda689 /bitbake/lib/bb/data_smart.py
parent9248bc1c53417e6581aa33fda683e765ad866426 (diff)
downloadpoky-f7f5e30667e1ad8e1ca76ee331be2843f2976bfa.tar.gz
poky-f7f5e30667e1ad8e1ca76ee331be2843f2976bfa.tar.bz2
poky-f7f5e30667e1ad8e1ca76ee331be2843f2976bfa.zip
bitbake: bitbake: data: Ensure task checksums account for remove data
Currently remove operations are not being accounted for in the task checksums. This is a fairly serious oversight and needs to be fixed. To do so, we need internal data from getVarFlag combined with the expanded variable data so that only "active" remove operators are accounted for in the task checksum. We can get this from the new optional removes attribute in the returned parser object. The code can then use the data on active remove operators to account for the removals in task checksum but only when the removal is active. We have to be careful here not to reference any expanded data since this may for example contain build paths. This means we can only map back and reference the unsplit (and hence unexpanded) remove string which may expand to multiple removal values. [YOCTO #12913] (Bitbake rev: 57d2ee17ae83a139a37081eb082e6184fa883581) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r--bitbake/lib/bb/data_smart.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 4ad0567c9a..8c4c6a9a32 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -805,7 +805,7 @@ class DataSmart(MutableMapping):
value = parser.value
if value and flag == "_content" and local_var is not None and "_remove" in local_var and not parsing:
- removes = []
+ removes = {}
self.need_overrides()
for (r, o) in local_var["_remove"]:
match = True
@@ -814,14 +814,23 @@ class DataSmart(MutableMapping):
if not o2 in self.overrides:
match = False
if match:
- removes.extend(self.expand(r).split())
-
- if removes:
- filtered = filter(lambda v: v not in removes,
- __whitespace_split__.split(value))
- value = "".join(filtered)
- if parser:
- parser.value = value
+ removes[r] = self.expand(r).split()
+
+ if removes and parser:
+ parser.removes = set()
+ val = ""
+ for v in __whitespace_split__.split(parser.value):
+ skip = False
+ for r in removes:
+ if v in removes[r]:
+ parser.removes.add(r)
+ skip = True
+ if skip:
+ continue
+ val = val + v
+ parser.value = val
+ if expand:
+ value = parser.value
if parser:
self.expand_cache[cachename] = parser