From d5e2dd47db886e728ca2a1cc9d771921c1f509d3 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Thu, 23 Apr 2015 15:38:52 +0300 Subject: recipeutils: implement get_recipe_local_files() (From OE-Core rev: c94cf6e6e8a0645c822a708a432901dcb5ce5bf4) Signed-off-by: Markus Lehtonen Signed-off-by: Richard Purdie --- meta/lib/oe/recipeutils.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'meta/lib/oe/recipeutils.py') diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index 5fd5dcba98..207c300667 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py @@ -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 = [] -- cgit v1.2.3-54-g00ecf