]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipeutils: implement get_recipe_local_files()
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 23 Apr 2015 12:38:52 +0000 (15:38 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Sep 2015 14:15:46 +0000 (15:15 +0100)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
meta/lib/oe/recipeutils.py

index 5fd5dcba98f2d34775403e4a074cfe3c8289df90..207c300667d8f3f33e985292b4b99fdd55b4f0d8 100644 (file)
@@ -336,6 +336,22 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True):
     return remotes
 
 
+def get_recipe_local_files(d, patches=False):
+    """Get a list of local files in SRC_URI within a recipe."""
+    uris = (d.getVar('SRC_URI', True) or "").split()
+    fetch = bb.fetch2.Fetch(uris, d)
+    ret = {}
+    for uri in uris:
+        if fetch.ud[uri].type == 'file':
+            if (not patches and
+                    bb.utils.exec_flat_python_func('patch_path', uri, fetch, '')):
+                continue
+            # Skip files that are referenced by absolute path
+            if not os.path.isabs(fetch.ud[uri].basepath):
+                ret[fetch.ud[uri].basepath] = fetch.localpath(uri)
+    return ret
+
+
 def get_recipe_patches(d):
     """Get a list of the patches included in SRC_URI within a recipe."""
     patchfiles = []