summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-16 14:16:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-18 10:59:26 +0100
commita9aa1d24c7c4518173f622a1fab55a98a16150f9 (patch)
tree688a3602fce0b04eab7119930ad41d730029244a /bitbake/lib/bb/data_smart.py
parent58530c6e481a2d237291af9e75d4417ecac7636b (diff)
downloadpoky-a9aa1d24c7c4518173f622a1fab55a98a16150f9.tar.gz
bitbake: data: Fix whitespace on _remove operations
We have some slightly odd behaviours with the current implementation of _remove operations. For example: TEST = " A B" TEST_remove = "C" would trigger TEST to become "A B" even thought it doesn't contain "C". In particular, this means that an inactive remove operator added in a bbappend could change the task checksum which is not desireable. Fix the operation to preserve whitespace, adding new tests to make this explict and test further corner cases. Also update the manual to match. (Bitbake rev: c0a23dd9155c50a6b7df796980bc7b612cac7994) 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.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 4434142a02..0a8488ca1b 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -42,6 +42,7 @@ __setvar_keyword__ = ["_append", "_prepend", "_remove"]
42__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$') 42__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$')
43__expand_var_regexp__ = re.compile(r"\${[^{}@\n\t :]+}") 43__expand_var_regexp__ = re.compile(r"\${[^{}@\n\t :]+}")
44__expand_python_regexp__ = re.compile(r"\${@.+?}") 44__expand_python_regexp__ = re.compile(r"\${@.+?}")
45__whitespace_split__ = re.compile('(\s)')
45 46
46def infer_caller_details(loginfo, parent = False, varval = True): 47def infer_caller_details(loginfo, parent = False, varval = True):
47 """Save the caller the trouble of specifying everything.""" 48 """Save the caller the trouble of specifying everything."""
@@ -818,8 +819,8 @@ class DataSmart(MutableMapping):
818 819
819 if removes: 820 if removes:
820 filtered = filter(lambda v: v not in removes, 821 filtered = filter(lambda v: v not in removes,
821 value.split()) 822 __whitespace_split__.split(value))
822 value = " ".join(filtered) 823 value = "".join(filtered)
823 if expand and var in self.expand_cache: 824 if expand and var in self.expand_cache:
824 # We need to ensure the expand cache has the correct value 825 # We need to ensure the expand cache has the correct value
825 # flag == "_content" here 826 # flag == "_content" here