diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-16 14:16:27 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-18 10:59:26 +0100 |
commit | a9aa1d24c7c4518173f622a1fab55a98a16150f9 (patch) | |
tree | 688a3602fce0b04eab7119930ad41d730029244a /bitbake/lib/bb/data_smart.py | |
parent | 58530c6e481a2d237291af9e75d4417ecac7636b (diff) | |
download | poky-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.py | 5 |
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 | ||
46 | def infer_caller_details(loginfo, parent = False, varval = True): | 47 | def 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 |