diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-12-11 15:32:55 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-14 23:14:56 +0000 |
commit | 3fbf3f8211183ecb18938f2fc9acaa400766d9f0 (patch) | |
tree | 5edecd17b93749837cf03d3100eec69bdbd1026e | |
parent | 7974203cd8bc66dff1fcc55f8723dedefaf72840 (diff) | |
download | bitbake-3fbf3f8211183ecb18938f2fc9acaa400766d9f0.tar.gz |
lib/bb/utils: fix error in edit_metadata() when deleting first line
If you tried to delete the variable on the first line passed to
edit_metadata() this failed because the logic for trimming extra blank
lines didn't expect the list to be empty at that point - fix that bad
assumption.
(Bitbake master rev: 8bce6fefdc5c046b916588962a2b429c0f648133)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py index 7f82687ae..9b2895223 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -1177,7 +1177,7 @@ def edit_metadata(meta_lines, variables, varfunc, match_overrides=False): if not skip: if checkspc: checkspc = False - if newlines[-1] == '\n' and line == '\n': + if newlines and newlines[-1] == '\n' and line == '\n': # Squash blank line if there are two consecutive blanks after a removal continue newlines.append(line) |