summaryrefslogtreecommitdiffstats
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 12:30:50 +0000
commit275b3fe5f47c5dabb5bd16e916bf6ad9118bee79 (patch)
tree20a9746f0df284a548e428c6bd8c6999a06efeff /meta/lib/oe/recipeutils.py
parent45adbe370908901d0d2e94b3c4daea821772e2ff (diff)
downloadpoky-275b3fe5f47c5dabb5bd16e916bf6ad9118bee79.tar.gz
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 <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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):
382 382
383def get_recipe_local_files(d, patches=False, archives=False): 383def get_recipe_local_files(d, patches=False, archives=False):
384 """Get a list of local files in SRC_URI within a recipe.""" 384 """Get a list of local files in SRC_URI within a recipe."""
385 import oe.patch
385 uris = (d.getVar('SRC_URI', True) or "").split() 386 uris = (d.getVar('SRC_URI', True) or "").split()
386 fetch = bb.fetch2.Fetch(uris, d) 387 fetch = bb.fetch2.Fetch(uris, d)
387 # FIXME this list should be factored out somewhere else (such as the 388 # 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):
393 for uri in uris: 394 for uri in uris:
394 if fetch.ud[uri].type == 'file': 395 if fetch.ud[uri].type == 'file':
395 if (not patches and 396 if (not patches and
396 bb.utils.exec_flat_python_func('patch_path', uri, fetch, '', expand=False)): 397 oe.patch.patch_path(uri, fetch, '', expand=False)):
397 continue 398 continue
398 # Skip files that are referenced by absolute path 399 # Skip files that are referenced by absolute path
399 fname = fetch.ud[uri].basepath 400 fname = fetch.ud[uri].basepath
@@ -418,10 +419,9 @@ def get_recipe_local_files(d, patches=False, archives=False):
418 419
419def get_recipe_patches(d): 420def get_recipe_patches(d):
420 """Get a list of the patches included in SRC_URI within a recipe.""" 421 """Get a list of the patches included in SRC_URI within a recipe."""
422 import oe.patch
423 patches = oe.patch.src_patches(d, expand=False)
421 patchfiles = [] 424 patchfiles = []
422 # Execute src_patches() defined in patch.bbclass - this works since that class
423 # is inherited globally
424 patches = bb.utils.exec_flat_python_func('src_patches', d, expand=False)
425 for patch in patches: 425 for patch in patches:
426 _, _, local, _, _, parm = bb.fetch.decodeurl(patch) 426 _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
427 patchfiles.append(local) 427 patchfiles.append(local)
@@ -438,9 +438,7 @@ def get_recipe_patched_files(d):
438 change mode ('A' for add, 'D' for delete or 'M' for modify) 438 change mode ('A' for add, 'D' for delete or 'M' for modify)
439 """ 439 """
440 import oe.patch 440 import oe.patch
441 # Execute src_patches() defined in patch.bbclass - this works since that class 441 patches = oe.patch.src_patches(d, expand=False)
442 # is inherited globally
443 patches = bb.utils.exec_flat_python_func('src_patches', d, expand=False)
444 patchedfiles = {} 442 patchedfiles = {}
445 for patch in patches: 443 for patch in patches:
446 _, _, patchfile, _, _, parm = bb.fetch.decodeurl(patch) 444 _, _, patchfile, _, _, parm = bb.fetch.decodeurl(patch)