aboutsummaryrefslogtreecommitdiffstats
path: root/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-16 17:43:57 +0100
commitc0a23dd9155c50a6b7df796980bc7b612cac7994 (patch)
tree2f361fe95dc2c28e747e5e0b2dc1796562f62206 /lib/bb/data_smart.py
parent11722c989077a8751a5d0653c523760bf91e6efa (diff)
downloadbitbake-c0a23dd9155c50a6b7df796980bc7b612cac7994.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r--lib/bb/data_smart.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 4434142a0..0a8488ca1 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -42,6 +42,7 @@ __setvar_keyword__ = ["_append", "_prepend", "_remove"]
__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$')
__expand_var_regexp__ = re.compile(r"\${[^{}@\n\t :]+}")
__expand_python_regexp__ = re.compile(r"\${@.+?}")
+__whitespace_split__ = re.compile('(\s)')
def infer_caller_details(loginfo, parent = False, varval = True):
"""Save the caller the trouble of specifying everything."""
@@ -818,8 +819,8 @@ class DataSmart(MutableMapping):
if removes:
filtered = filter(lambda v: v not in removes,
- value.split())
- value = " ".join(filtered)
+ __whitespace_split__.split(value))
+ value = "".join(filtered)
if expand and var in self.expand_cache:
# We need to ensure the expand cache has the correct value
# flag == "_content" here