aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/utils.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-11-20 17:11:15 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-07 17:00:16 +0000
commit8bce6fefdc5c046b916588962a2b429c0f648133 (patch)
treefa456ca15f9df5699324765d60654c4853736089 /lib/bb/utils.py
parent7546d4aeb3ba8fda9832081b84d93138dc5e58d6 (diff)
downloadbitbake-8bce6fefdc5c046b916588962a2b429c0f648133.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. Signed-off-by: Paul Eggleton <paul.eggleton@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 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)