[OE-core] [devtool][PATCH] devtool deploy-target: optionally specify package
Trevor Woerner
twoerner at gmail.com
Thu May 31 20:06:59 UTC 2018
Instead of installing an entire recipe's build output (i.e. ${D}), allow the
user to optionally specify a package from said recipe to be installed
exclusively (i.e. ${PKGDEST}/<package>).
Signed-off-by: Trevor Woerner <twoerner at gmail.com>
---
scripts/lib/devtool/deploy.py | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/scripts/lib/devtool/deploy.py b/scripts/lib/devtool/deploy.py
index 52e261d560..c022757519 100644
--- a/scripts/lib/devtool/deploy.py
+++ b/scripts/lib/devtool/deploy.py
@@ -169,11 +169,20 @@ def deploy(args, config, basepath, workspace):
except Exception as e:
raise DevtoolError('Exception parsing recipe %s: %s' %
(args.recipename, e))
- recipe_outdir = rd.getVar('D')
+ if args.package:
+ recipe_outdir = os.path.join(rd.getVar('PKGDEST'), args.package)
+ else:
+ recipe_outdir = rd.getVar('D')
if not os.path.exists(recipe_outdir) or not os.listdir(recipe_outdir):
- raise DevtoolError('No files to deploy - have you built the %s '
- 'recipe? If so, the install step has not installed '
- 'any files.' % args.recipename)
+ if args.package:
+ raise DevtoolError('No files to deploy - have you built the %s '
+ 'package of the %s recipe? If so, the install '
+ 'step has not installed any files.'
+ % (args.package, args.recipename))
+ else:
+ raise DevtoolError('No files to deploy - have you built the %s '
+ 'recipe? If so, the install step has not installed '
+ 'any files.' % args.recipename)
if args.strip and not args.dry_run:
# Fakeroot copy to new destination
@@ -314,8 +323,8 @@ def register_commands(subparsers, context):
"""Register devtool subcommands from the deploy plugin"""
parser_deploy = subparsers.add_parser('deploy-target',
- help='Deploy recipe output files to live target machine',
- description='Deploys a recipe\'s build output (i.e. the output of the do_install task) to a live target machine over ssh. By default, any existing files will be preserved instead of being overwritten and will be restored if you run devtool undeploy-target. Note: this only deploys the recipe itself and not any runtime dependencies, so it is assumed that those have been installed on the target beforehand.',
+ help='Deploy build output to a live target machine',
+ description='Deploys either the full recipe\'s build output (i.e. the output of the do_install task) or a package of a recipe to a live target machine over ssh. By default, any existing files will be preserved instead of being overwritten and will be restored if you run devtool undeploy-target. Note: this only deploys the specified item itself and not any runtime dependencies, so it is assumed that those have been installed on the target beforehand.',
group='testbuild')
parser_deploy.add_argument('recipename', help='Recipe to deploy')
parser_deploy.add_argument('target', help='Live target machine running an ssh server: user at hostname[:destdir]')
@@ -325,6 +334,7 @@ def register_commands(subparsers, context):
parser_deploy.add_argument('-p', '--no-preserve', help='Do not preserve existing files', action='store_true')
parser_deploy.add_argument('--no-check-space', help='Do not check for available space before deploying', action='store_true')
parser_deploy.add_argument('-P', '--port', help='Specify port to use for connection to the target')
+ parser_deploy.add_argument('--package', help='Specify a recipe\'s package to deploy', dest='package')
strip_opts = parser_deploy.add_mutually_exclusive_group(required=False)
strip_opts.add_argument('-S', '--strip',
@@ -337,8 +347,8 @@ def register_commands(subparsers, context):
parser_deploy.set_defaults(func=deploy)
parser_undeploy = subparsers.add_parser('undeploy-target',
- help='Undeploy recipe output files in live target machine',
- description='Un-deploys recipe output files previously deployed to a live target machine by devtool deploy-target.',
+ help='Undeploy output files from a live target machine',
+ description='Un-deploys output files previously deployed to a live target machine by devtool deploy-target.',
group='testbuild')
parser_undeploy.add_argument('recipename', help='Recipe to undeploy (if not using -a/--all)', nargs='?')
parser_undeploy.add_argument('target', help='Live target machine running an ssh server: user at hostname')
--
2.17.0.582.gccdcbd54c
More information about the Openembedded-core
mailing list