]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: lib/bb/utils: fix error in edit_metadata() when deleting first line
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 20 Nov 2015 04:11:15 +0000 (17:11 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 7 Dec 2015 17:01:21 +0000 (17:01 +0000)
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 <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/utils.py

index 7f82687ae4f8544d8caf977a7ca4e427a445ff65..9b28952231107f108959f51f59e658b18e635e62 100644 (file)
@@ -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)