diff options
Diffstat (limited to 'scripts/lib/devtool/package.py')
| -rw-r--r-- | scripts/lib/devtool/package.py | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/scripts/lib/devtool/package.py b/scripts/lib/devtool/package.py deleted file mode 100644 index c2367342c3..0000000000 --- a/scripts/lib/devtool/package.py +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | # Development tool - package command plugin | ||
| 2 | # | ||
| 3 | # Copyright (C) 2014-2015 Intel Corporation | ||
| 4 | # | ||
| 5 | # SPDX-License-Identifier: GPL-2.0-only | ||
| 6 | # | ||
| 7 | """Devtool plugin containing the package subcommands""" | ||
| 8 | |||
| 9 | import os | ||
| 10 | import subprocess | ||
| 11 | import logging | ||
| 12 | from bb.process import ExecutionError | ||
| 13 | from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, DevtoolError | ||
| 14 | |||
| 15 | logger = logging.getLogger('devtool') | ||
| 16 | |||
| 17 | def package(args, config, basepath, workspace): | ||
| 18 | """Entry point for the devtool 'package' subcommand""" | ||
| 19 | check_workspace_recipe(workspace, args.recipename) | ||
| 20 | |||
| 21 | tinfoil = setup_tinfoil(basepath=basepath, config_only=True) | ||
| 22 | try: | ||
| 23 | image_pkgtype = config.get('Package', 'image_pkgtype', '') | ||
| 24 | if not image_pkgtype: | ||
| 25 | image_pkgtype = tinfoil.config_data.getVar('IMAGE_PKGTYPE') | ||
| 26 | |||
| 27 | deploy_dir_pkg = tinfoil.config_data.getVar('DEPLOY_DIR_%s' % image_pkgtype.upper()) | ||
| 28 | finally: | ||
| 29 | tinfoil.shutdown() | ||
| 30 | |||
| 31 | package_task = config.get('Package', 'package_task', 'package_write_%s' % image_pkgtype) | ||
| 32 | try: | ||
| 33 | exec_build_env_command(config.init_path, basepath, 'bitbake -c %s %s' % (package_task, args.recipename), watch=True) | ||
| 34 | except bb.process.ExecutionError as e: | ||
| 35 | # We've already seen the output since watch=True, so just ensure we return something to the user | ||
| 36 | return e.exitcode | ||
| 37 | |||
| 38 | logger.info('Your packages are in %s' % deploy_dir_pkg) | ||
| 39 | |||
| 40 | return 0 | ||
| 41 | |||
| 42 | def register_commands(subparsers, context): | ||
| 43 | """Register devtool subcommands from the package plugin""" | ||
| 44 | if context.fixed_setup: | ||
| 45 | parser_package = subparsers.add_parser('package', | ||
| 46 | help='Build packages for a recipe', | ||
| 47 | description='Builds packages for a recipe\'s output files', | ||
| 48 | group='testbuild', order=-5) | ||
| 49 | parser_package.add_argument('recipename', help='Recipe to package') | ||
| 50 | parser_package.set_defaults(func=package) | ||
