diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-05-22 16:42:22 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-23 08:21:42 +0100 |
commit | 12cc076832130f9b3a2658bc92458624d2924742 (patch) | |
tree | d612b75014fd7ac58f5246b1f511727775baa8bb /bitbake | |
parent | ca6ef30c7a33b3860d9b0d0da51d9b8786073170 (diff) | |
download | ast2050-yocto-poky-12cc076832130f9b3a2658bc92458624d2924742.zip ast2050-yocto-poky-12cc076832130f9b3a2658bc92458624d2924742.tar.gz |
bitbake: lib/bb/utils: fix several bugs in edit_metadata_file()
* Fix unchanged assignments being dropped if other lines changed
* Fix not passing variable name from single-line assignments to the
function
* Fix not trimming the trailing quote from values
(Bitbake master rev: 0b0c82f49cf2de887967d305768cbd95314bb171)
(Bitbake rev: cd92e5dce5f5d61ecb7838bf964a7812e905509a)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/utils.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 1681efd..0db7e56 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -974,6 +974,7 @@ def edit_metadata_file(meta_file, variables, func): updated = False varset_start = '' + varlines = [] newlines = [] in_var = None full_value = '' @@ -1001,14 +1002,19 @@ def edit_metadata_file(meta_file, variables, func): else: newlines.append('%s "%s"\n' % (varset_start, newvalue)) return True - return False + else: + # Put the old lines back where they were + newlines.extend(varlines) + return False with open(meta_file, 'r') as f: for line in f: if in_var: value = line.rstrip() + varlines.append(line) full_value += value[:-1] if value.endswith('"') or value.endswith("'"): + full_value = full_value[:-1] if handle_var_end(): updated = True in_var = None @@ -1022,11 +1028,13 @@ def edit_metadata_file(meta_file, variables, func): if value.endswith('\\'): value = value[:-1] full_value = value + varlines = [line] + in_var = varname if value.endswith('"') or value.endswith("'"): + full_value = full_value[:-1] if handle_var_end(): updated = True - else: - in_var = varname + in_var = None matched = True break if not matched: |