summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-08-30 17:41:29 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-31 11:37:12 +0100
commit61ecb6ce47fac3d1d4c2f346bafac710ed9da0d4 (patch)
tree47386357a1c14c968de6c5b8a640a98404e7396b /scripts
parent214dd950c93d739dc040e238ef086fed1bfe3e8d (diff)
downloadpoky-61ecb6ce47fac3d1d4c2f346bafac710ed9da0d4.tar.gz
devtool: build-image: filter out recipes
Filtered out non-target recipes and recipes with recipe name != package name in build-image plugin. Isolated all logic of getting recipes in _get_recipes function. (From OE-Core rev: efe685711ae6f4beec06ba591c74140ce56b96af) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/build-image.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/scripts/lib/devtool/build-image.py b/scripts/lib/devtool/build-image.py
index 708120a861..341ab28d8e 100644
--- a/scripts/lib/devtool/build-image.py
+++ b/scripts/lib/devtool/build-image.py
@@ -21,7 +21,7 @@ import os
21import logging 21import logging
22 22
23from bb.process import ExecutionError 23from bb.process import ExecutionError
24from devtool import exec_build_env_command 24from devtool import exec_build_env_command, setup_tinfoil, parse_recipe
25 25
26logger = logging.getLogger('devtool') 26logger = logging.getLogger('devtool')
27 27
@@ -29,14 +29,31 @@ def plugin_init(pluginlist):
29 """Plugin initialization""" 29 """Plugin initialization"""
30 pass 30 pass
31 31
32def _get_recipes(workspace, config):
33 """Get list of target recipes from the workspace."""
34 result = []
35 tinfoil = setup_tinfoil()
36 for recipe in workspace:
37 data = parse_recipe(config, tinfoil, recipe, True)
38 if 'class-target' in data.getVar('OVERRIDES', True).split(':'):
39 if recipe in data.getVar('PACKAGES', True):
40 result.append(recipe)
41 else:
42 logger.warning("Skipping recipe %s as it doesn't produce "
43 "package with the same name", recipe)
44 tinfoil.shutdown()
45 return result
46
32def build_image(args, config, basepath, workspace): 47def build_image(args, config, basepath, workspace):
33 """Entry point for the devtool 'build-image' subcommand.""" 48 """Entry point for the devtool 'build-image' subcommand."""
34 image = args.recipe 49 image = args.recipe
35 appendfile = os.path.join(config.workspace_path, 'appends', 50 appendfile = os.path.join(config.workspace_path, 'appends',
36 '%s.bbappend' % image) 51 '%s.bbappend' % image)
37 with open(appendfile, 'w') as afile: 52
38 afile.write('IMAGE_INSTALL_append = " %s"\n' % \ 53 recipes = _get_recipes(workspace, config)
39 ' '.join(workspace.keys())) 54 if recipes:
55 with open(appendfile, 'w') as afile:
56 afile.write('IMAGE_INSTALL_append = " %s"\n' % ' '.join(recipes))
40 57
41 try: 58 try:
42 exec_build_env_command(config.init_path, basepath, 59 exec_build_env_command(config.init_path, basepath,