From 275b3fe5f47c5dabb5bd16e916bf6ad9118bee79 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Tue, 13 Dec 2016 20:09:39 +1300 Subject: classes/patch: move several functions to oe.patch Move patch_path(), src_patches() and should_apply() to oe.patch, making them easier to call from elsewhere (particularly across the UI/server boundary). (From OE-Core rev: 2724511e18810cc8082c1b028e3b7c8a8b5def56) Signed-off-by: Paul Eggleton Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/lib/oe/recipeutils.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'meta/lib/oe/recipeutils.py') diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index ae83aabec1..92fa431e0b 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py @@ -382,6 +382,7 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True): def get_recipe_local_files(d, patches=False, archives=False): """Get a list of local files in SRC_URI within a recipe.""" + import oe.patch uris = (d.getVar('SRC_URI', True) or "").split() fetch = bb.fetch2.Fetch(uris, d) # FIXME this list should be factored out somewhere else (such as the @@ -393,7 +394,7 @@ def get_recipe_local_files(d, patches=False, archives=False): for uri in uris: if fetch.ud[uri].type == 'file': if (not patches and - bb.utils.exec_flat_python_func('patch_path', uri, fetch, '', expand=False)): + oe.patch.patch_path(uri, fetch, '', expand=False)): continue # Skip files that are referenced by absolute path fname = fetch.ud[uri].basepath @@ -418,10 +419,9 @@ def get_recipe_local_files(d, patches=False, archives=False): def get_recipe_patches(d): """Get a list of the patches included in SRC_URI within a recipe.""" + import oe.patch + patches = oe.patch.src_patches(d, expand=False) patchfiles = [] - # Execute src_patches() defined in patch.bbclass - this works since that class - # is inherited globally - patches = bb.utils.exec_flat_python_func('src_patches', d, expand=False) for patch in patches: _, _, local, _, _, parm = bb.fetch.decodeurl(patch) patchfiles.append(local) @@ -438,9 +438,7 @@ def get_recipe_patched_files(d): change mode ('A' for add, 'D' for delete or 'M' for modify) """ import oe.patch - # Execute src_patches() defined in patch.bbclass - this works since that class - # is inherited globally - patches = bb.utils.exec_flat_python_func('src_patches', d, expand=False) + patches = oe.patch.src_patches(d, expand=False) patchedfiles = {} for patch in patches: _, _, patchfile, _, _, parm = bb.fetch.decodeurl(patch) -- cgit v1.2.3-54-g00ecf