From: Paul Eggleton Date: Tue, 22 Dec 2015 04:02:58 +0000 (+1300) Subject: recipetool: create: minor fix for potential issue in python handling X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~27954 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95d33e90f2d5d9dd5ccc950856b8a939fefb831e;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git recipetool: create: minor fix for potential issue in python handling If SRC_URI happened not to be in the pre-generated lines then this code would error out. This is unlikely to happen with the way the create code is structured at the moment, but handle it just in case. Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py index e0af2a0f51a..266c4235470 100644 --- a/scripts/lib/recipetool/create_buildsys_python.py +++ b/scripts/lib/recipetool/create_buildsys_python.py @@ -278,7 +278,10 @@ class PythonRecipeHandler(RecipeHandler): for k in sorted(bbinfo): v = bbinfo[k] mdinfo.append('{} = "{}"'.format(k, v)) - lines_before[src_uri_line-1:src_uri_line-1] = mdinfo + if src_uri_line: + lines_before[src_uri_line-1:src_uri_line-1] = mdinfo + else: + lines_before.extend(mdinfo) mapped_deps, unmapped_deps = self.scan_setup_python_deps(srctree, setup_info, setup_non_literals)