From 866f6e2de20b7022803e53c4de3ff341521b4db5 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Tue, 22 Sep 2015 17:21:35 +0100 Subject: devtool: build-image: fix recipe/package terminology We build recipes and include packages into the image, adjust the terminology used in code and messages accordingly. Also fix a few typos. Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- scripts/lib/devtool/build-image.py | 45 ++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/scripts/lib/devtool/build-image.py b/scripts/lib/devtool/build-image.py index 2c014289fe..fa6f0d738a 100644 --- a/scripts/lib/devtool/build-image.py +++ b/scripts/lib/devtool/build-image.py @@ -25,8 +25,8 @@ from devtool import exec_build_env_command, setup_tinfoil, parse_recipe logger = logging.getLogger('devtool') -def _get_recipes(workspace, config): - """Get list of target recipes from the workspace.""" +def _get_packages(workspace, config): + """Get list of packages from recipes in the workspace.""" result = [] tinfoil = setup_tinfoil() for recipe in workspace: @@ -35,7 +35,7 @@ def _get_recipes(workspace, config): if recipe in data.getVar('PACKAGES', True): result.append(recipe) else: - logger.warning("Skipping recipe %s as it doesn't produce " + logger.warning("Skipping recipe %s as it doesn't produce a " "package with the same name", recipe) tinfoil.shutdown() return result @@ -46,29 +46,32 @@ def build_image(args, config, basepath, workspace): appendfile = os.path.join(config.workspace_path, 'appends', '%s.bbappend' % image) - # remove .bbapend to make sure setup_tinfoil doesn't - # breake because of it + # remove .bbappend to make sure setup_tinfoil doesn't + # break because of it if os.path.isfile(appendfile): os.unlink(appendfile) - recipes = _get_recipes(workspace, config) - if recipes: - with open(appendfile, 'w') as afile: - # include selected recipes into the image - afile.write('IMAGE_INSTALL_append = " %s"\n' % ' '.join(recipes)) + if workspace: + packages = _get_packages(workspace, config) + if packages: + with open(appendfile, 'w') as afile: + # include packages from workspace recipes into the image + afile.write('IMAGE_INSTALL_append = " %s"\n' % ' '.join(packages)) - # Generate notification callback devtool_warn_image_extended - afile.write('do_rootfs[prefuncs] += "devtool_warn_image_extended"\n\n') - afile.write("python devtool_warn_image_extended() {\n") - afile.write(" bb.plain('NOTE: %%s: building with additional '\n" - " 'packages due to \"devtool build-image\"'" - " %% d.getVar('PN', True))\n" - " bb.plain('NOTE: delete %%s to clear this' %% \\\n" - " '%s')\n" % os.path.relpath(appendfile, basepath)) - afile.write("}\n") + # Generate notification callback devtool_warn_image_extended + afile.write('do_rootfs[prefuncs] += "devtool_warn_image_extended"\n\n') + afile.write("python devtool_warn_image_extended() {\n") + afile.write(" bb.plain('NOTE: %%s: building with additional '\n" + " 'packages due to \"devtool build-image\"'" + " %% d.getVar('PN', True))\n" + " bb.plain('NOTE: delete %%s to clear this' %% \\\n" + " '%s')\n" % os.path.relpath(appendfile, basepath)) + afile.write("}\n") - logger.info('Building image %s with the following ' - 'additional packages: %s', image, ' '.join(recipes)) + logger.info('Building image %s with the following ' + 'additional packages: %s', image, ' '.join(packages)) + else: + logger.warning('No packages to add, building image %s unmodified', image) else: logger.warning('No recipes in workspace, building image %s unmodified', image) -- cgit 1.2.3-korg