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.

(From OE-Core rev: 95d33e90f2d5d9dd5ccc950856b8a939fefb831e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2015-12-22 17:02:58 +13:00 committed by Richard Purdie
parent ae2141b84f
commit e61645b504
1 changed files with 4 additions and 1 deletions

View File

@ -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)