summaryrefslogtreecommitdiff
path: root/meta/lib/oe/recipeutils.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-13 20:09:39 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-14 09:56:35 +0000
commit2724511e18810cc8082c1b028e3b7c8a8b5def56 (patch)
tree6ad6096cc3f5d35993d18291f55a8660628ed395 /meta/lib/oe/recipeutils.py
parentf24f59ea1d8bc335ea8576f6a346d0935f4a3548 (diff)
downloadopenembedded-core-2724511e18810cc8082c1b028e3b7c8a8b5def56.tar.gz
openembedded-core-2724511e18810cc8082c1b028e3b7c8a8b5def56.tar.bz2
openembedded-core-2724511e18810cc8082c1b028e3b7c8a8b5def56.zip
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). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oe/recipeutils.py')
-rw-r--r--meta/lib/oe/recipeutils.py12
1 files changed, 5 insertions, 7 deletions
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)