[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    Re: [OE-core] [devtool][PATCH] devtool deploy-target: optionally specify package
From:       Andre McCurdy <armccurdy () gmail ! com>
Date:       2018-05-31 22:22:58
Message-ID: CAJ86T=XTDOZYzdUTBLSO39XeBu6QhV0U5+U=iGd_hM0OwBXH_Q () mail ! gmail ! com
[Download RAW message or body]

On Thu, May 31, 2018 at 1:06 PM, Trevor Woerner <twoerner@gmail.com> wrote:
> 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>).

I'm not a big devtool user myself, but I'm curious about the
situations where you might need this?

Are the going to be problems if users want to deploy more than one
package (or switch between a full deploy and a package) and don't
deploy and undeploy in the right order?

> Signed-off-by: Trevor Woerner <twoerner@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@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@hostname')
> --
> 2.17.0.582.gccdcbd54c
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic