diff options
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 1681efd7e5..0db7e56651 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): | |||
974 | 974 | ||
975 | updated = False | 975 | updated = False |
976 | varset_start = '' | 976 | varset_start = '' |
977 | varlines = [] | ||
977 | newlines = [] | 978 | newlines = [] |
978 | in_var = None | 979 | in_var = None |
979 | full_value = '' | 980 | full_value = '' |
@@ -1001,14 +1002,19 @@ def edit_metadata_file(meta_file, variables, func): | |||
1001 | else: | 1002 | else: |
1002 | newlines.append('%s "%s"\n' % (varset_start, newvalue)) | 1003 | newlines.append('%s "%s"\n' % (varset_start, newvalue)) |
1003 | return True | 1004 | return True |
1004 | return False | 1005 | else: |
1006 | # Put the old lines back where they were | ||
1007 | newlines.extend(varlines) | ||
1008 | return False | ||
1005 | 1009 | ||
1006 | with open(meta_file, 'r') as f: | 1010 | with open(meta_file, 'r') as f: |
1007 | for line in f: | 1011 | for line in f: |
1008 | if in_var: | 1012 | if in_var: |
1009 | value = line.rstrip() | 1013 | value = line.rstrip() |
1014 | varlines.append(line) | ||
1010 | full_value += value[:-1] | 1015 | full_value += value[:-1] |
1011 | if value.endswith('"') or value.endswith("'"): | 1016 | if value.endswith('"') or value.endswith("'"): |
1017 | full_value = full_value[:-1] | ||
1012 | if handle_var_end(): | 1018 | if handle_var_end(): |
1013 | updated = True | 1019 | updated = True |
1014 | in_var = None | 1020 | in_var = None |
@@ -1022,11 +1028,13 @@ def edit_metadata_file(meta_file, variables, func): | |||
1022 | if value.endswith('\\'): | 1028 | if value.endswith('\\'): |
1023 | value = value[:-1] | 1029 | value = value[:-1] |
1024 | full_value = value | 1030 | full_value = value |
1031 | varlines = [line] | ||
1032 | in_var = varname | ||
1025 | if value.endswith('"') or value.endswith("'"): | 1033 | if value.endswith('"') or value.endswith("'"): |
1034 | full_value = full_value[:-1] | ||
1026 | if handle_var_end(): | 1035 | if handle_var_end(): |
1027 | updated = True | 1036 | updated = True |
1028 | else: | 1037 | in_var = None |
1029 | in_var = varname | ||
1030 | matched = True | 1038 | matched = True |
1031 | break | 1039 | break |
1032 | if not matched: | 1040 | if not matched: |