]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/externalsrc: fix for recipes that fetch local files
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 9 Mar 2015 13:57:56 +0000 (13:57 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Mar 2015 11:03:12 +0000 (11:03 +0000)
If SRC_URI contains local files (file:// references) these will almost
certainly be required at some point during the build process, so we need
to actually fetch these to ${WORKDIR} as we would normally.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/externalsrc.bbclass

index 25f0be96a512fad40a7d02c65d2ad25f9390775a..75bdb7a14d4a3edb2a0d7a67c9dd9aa42fe5c01d 100644 (file)
@@ -35,7 +35,13 @@ python () {
             d.setVar('B', externalsrcbuild)
         else:
             d.setVar('B', '${WORKDIR}/${BPN}-${PV}/')
-        d.setVar('SRC_URI', '')
+
+        srcuri = (d.getVar('SRC_URI', True) or '').split()
+        local_srcuri = []
+        for uri in srcuri:
+            if uri.startswith('file://'):
+                local_srcuri.append(uri)
+        d.setVar('SRC_URI', ' '.join(local_srcuri))
 
         if '{SRCPV}' in d.getVar('PV', False):
             # Dummy value because the default function can't be called with blank SRC_URI
@@ -65,7 +71,13 @@ python () {
                 if setvalue:
                     d.setVarFlag(task, 'cleandirs', ' '.join(cleandirs))
 
+        fetch_tasks = ['do_fetch', 'do_unpack']
+        # If we deltask do_patch, there's no dependency to ensure do_unpack gets run, so add one
+        d.appendVarFlag('do_configure', 'deps', ['do_unpack'])
+
         for task in d.getVar("SRCTREECOVEREDTASKS", True).split():
+            if local_srcuri and task in fetch_tasks:
+                continue
             bb.build.deltask(task, d)
 
         d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ")