From: Paul Eggleton Date: Fri, 20 Nov 2015 04:11:15 +0000 (+1300) Subject: bitbake: lib/bb/utils: fix error in edit_metadata() when deleting first line X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0debb11883379c746f91eb8a5262f22a669fd16b;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bitbake: 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 rev: 8bce6fefdc5c046b916588962a2b429c0f648133) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 7f82687ae4f..9b289522311 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/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)