aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/utils.py
diff options
context:
space:
mode:
authorRandy Witt <randy.e.witt@linux.intel.com>2016-04-06 23:55:39 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-09 07:58:09 +0100
commit14f05cbdc2ad8d59a94af1c8816567d93c39c88c (patch)
tree6e6309def14b2476088f078e0814dedc44c98de9 /lib/bb/utils.py
parent292bffc8412cd0ddc0c6d16e872c7801e1a67890 (diff)
downloadbitbake-14f05cbdc2ad8d59a94af1c8816567d93c39c88c.tar.gz
lib/bb/utils.py: Fix a bug in edit_metadata() that could corrupt vars
edit_metadata() would corrupt a variable that was multiline, but had the ending quotes on the same line as the last value. For example: TEST_VAR = " foo \ bar" would become " foo ba" because the code would always delete the last character on the line and then do it again if the line ended in the quote. This however doesn't show up if you have: TEST_VAR = " foo \ bar \ " which is how all the test cases were written. This patch fixes that bug and adds and fixes a test that matched the bugs behavior rather than the expected behavior. Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/utils.py')
-rw-r--r--lib/bb/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index e9ad68f2d..8d7df13be 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -1158,7 +1158,7 @@ def edit_metadata(meta_lines, variables, varfunc, match_overrides=False):
if in_var.endswith('()'):
if full_value.count('{') - full_value.count('}') >= 0:
continue
- full_value = full_value[:-1]
+ full_value = full_value[:-1]
if handle_var_end():
updated = True
checkspc = True