summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/recipeutils.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-07-25 20:47:17 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-08 23:47:13 +0000
commitbd2cc670bed358fde65eaf36e0583fe4b0027ebc (patch)
tree12225d5ff3a1507a221c75fe356a89839a056b59 /meta/lib/oe/recipeutils.py
parentb108f2a6de6c6e004895b5453d4c373e467ee7c8 (diff)
downloadpoky-bd2cc670bed358fde65eaf36e0583fe4b0027ebc.tar.gz
lib/oe/recipeutils: fix patch_recipe*() with empty input
If you supplied an empty file to patch_recipe() (or an empty list to patch_recipe_lines()) then the result was IndexError because the code checking to see if it needed to add an extra line of padding didn't check to see if there were in fact any lines before trying to access the last line. Fixes [YOCTO #9972]. (From OE-Core rev: 92a73e870478ddb2a2d137e3fff28828809bec2e) (From OE-Core rev: 5ce14441f02894e68881807138e8f45074900ba2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/recipeutils.py')
-rw-r--r--meta/lib/oe/recipeutils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 6c7adb5bdb..304989cfc5 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -255,7 +255,7 @@ def patch_recipe_file(fn, values, patch=False, relpath=''):
255 changed, tolines = bb.utils.edit_metadata(fromlines, varlist, patch_recipe_varfunc, match_overrides=True) 255 changed, tolines = bb.utils.edit_metadata(fromlines, varlist, patch_recipe_varfunc, match_overrides=True)
256 256
257 if remainingnames: 257 if remainingnames:
258 if tolines[-1].strip() != '': 258 if tolines and tolines[-1].strip() != '':
259 tolines.append('\n') 259 tolines.append('\n')
260 for k in remainingnames.keys(): 260 for k in remainingnames.keys():
261 outputvalue(k, tolines) 261 outputvalue(k, tolines)