]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipetool: create: minor fix for potential issue in python handling
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 22 Dec 2015 04:02:58 +0000 (17:02 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 22 Dec 2015 16:44:03 +0000 (16:44 +0000)
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 <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/recipetool/create_buildsys_python.py

index e0af2a0f51a808c45c8340bfd5e5ec06a9f60f10..266c4235470264449091039fe57fd7770e8bfe76 100644 (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)