<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 8, 2019 at 10:37 AM Peter Kjellerstedt <<a href="mailto:peter.kjellerstedt@axis.com">peter.kjellerstedt@axis.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> -----Original Message-----<br>
> From: <a href="mailto:openembedded-core-bounces@lists.openembedded.org" target="_blank">openembedded-core-bounces@lists.openembedded.org</a> <openembedded-<br>
> <a href="mailto:core-bounces@lists.openembedded.org" target="_blank">core-bounces@lists.openembedded.org</a>> On Behalf Of Chandana Kalluri<br>
> Sent: den 8 oktober 2019 04:14<br>
> To: Paul Eggleton <<a href="mailto:paul.eggleton@linux.intel.com" target="_blank">paul.eggleton@linux.intel.com</a>><br>
> Cc: Patches and discussions about the oe-core layer <openembedded-<br>
> <a href="mailto:core@lists.openembedded.org" target="_blank">core@lists.openembedded.org</a>><br>
> Subject: Re: [OE-core] [OE-Core][master][PATCH] devtool: Add --remove-<br>
> work option for devtool reset command<br>
> <br>
> Hi Paul,<br>
> <br>
> Any thoughts on implementing this as a separate command as suggested<br>
> by Khem?<br>
<br>
For what it's worth, I think the original suggested solution with a new <br>
option to the existing `devtool reset` and `devtool finish` commands is <br>
the better one.</blockquote><div dir="auto"><br></div><div dir="auto">Yeah thinking about it again we already have two commands which would need same functionality it’s not good to introduce a third one although I think the usability of current solution will be a bit nicer if it was independent option </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> > -----Original Message-----<br>
> > From: Khem Raj <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><br>
> > Sent: Monday, October 7, 2019 11:40 AM<br>
> > To: Chandana Kalluri <<a href="mailto:ckalluri@xilinx.com" target="_blank">ckalluri@xilinx.com</a>><br>
> > Cc: Patches and discussions about the oe-core layer <openembedded-<br>
> > <a href="mailto:core@lists.openembedded.org" target="_blank">core@lists.openembedded.org</a>><br>
> > Subject: Re: [OE-core] [OE-Core][master][PATCH] devtool: Add --<br>
> remove-work<br>
> > option for devtool reset command<br>
> ><br>
> > On Mon, Oct 7, 2019 at 11:36 AM Sai Hari Chandana Kalluri<br>
> > <<a href="mailto:chandana.kalluri@xilinx.com" target="_blank">chandana.kalluri@xilinx.com</a>> wrote:<br>
> > ><br>
> > > Enable --remove-work option for devtool reset command that allows<br>
> user<br>
> > > to clean up source directory within workspace.<br>
> > ><br>
> > > Currently devtool reset command only removes recipes and user is<br>
> > > forced to manually remove the sources directory within the<br>
> workspace<br>
> > > before running devtool modify again.<br>
> > ><br>
> > > Using devtool reset -r or devtool reset --remove-work option, user<br>
> can<br>
> > > cleanup the sources directory along with the recipe instead of<br>
> > > manually cleaning it.<br>
> ><br>
> > perhaps we can have another cmd like "reset-all" like cleanall ?<br>
> > which would remove everything that devtool did external to bblayers<br>
> for that<br>
> > recipe.<br>
> ><br>
> > ><br>
> > > syntax: devtool reset -r <recipename><br>
> > > Ex: devtool reset -r zip<br>
> > ><br>
> > > devtool finish -r <recipename> <layer-name><br>
> > > Ex: devtool finish -r zip meta-yocto-bsp<br>
> > ><br>
> > > Signed-off-by: Sai Hari Chandana Kalluri<br>
> <<a href="mailto:chandana.kalluri@xilinx.com" target="_blank">chandana.kalluri@xilinx.com</a>><br>
> > > ---<br>
> > > scripts/lib/devtool/standard.py | 26 +++++++++++++++++++-------<br>
> > > 1 file changed, 19 insertions(+), 7 deletions(-)<br>
> > ><br>
> > > diff --git a/scripts/lib/devtool/standard.py<br>
> > > b/scripts/lib/devtool/standard.py index 60c9a04..1c0cd8a 100644<br>
> > > --- a/scripts/lib/devtool/standard.py<br>
> > > +++ b/scripts/lib/devtool/standard.py<br>
> > > @@ -1852,7 +1852,7 @@ def status(args, config, basepath,<br>
> workspace):<br>
> > > return 0<br>
> > ><br>
> > ><br>
> > > -def _reset(recipes, no_clean, config, basepath, workspace):<br>
> > > +def _reset(recipes, no_clean, remove_work, config, basepath,<br>
> workspace):<br>
> > > """Reset one or more recipes"""<br>
> > > import oe.path<br>
> > ><br>
> > > @@ -1930,10 +1930,15 @@ def _reset(recipes, no_clean, config,<br>
> basepath,<br>
> > workspace):<br>
> > > srctreebase = workspace[pn]['srctreebase']<br>
> > > if os.path.isdir(srctreebase):<br>
> > > if os.listdir(srctreebase):<br>
> > > - # We don't want to risk wiping out any work in<br>
> progress<br>
> > > - <a href="http://logger.info" rel="noreferrer" target="_blank">logger.info</a>('Leaving source tree %s as-is; if you<br>
> no '<br>
> > > - 'longer need it then please delete it<br>
> manually'<br>
> > > - % srctreebase)<br>
> > > + if remove_work:<br>
> > > + <a href="http://logger.info" rel="noreferrer" target="_blank">logger.info</a>('-r argument used on %s,<br>
> removing source tree.'<br>
> > > + ' You will lose any unsaved<br>
> work' %pn)<br>
> > > + shutil.rmtree(srctreebase)<br>
> > > + else:<br>
> > > + # We don't want to risk wiping out any<br>
> work in progress<br>
> > > + <a href="http://logger.info" rel="noreferrer" target="_blank">logger.info</a>('Leaving source tree %s as-is;<br>
> if you no '<br>
> > > + 'longer need it then please<br>
> delete it manually'<br>
> > > + % srctreebase)<br>
> > > else:<br>
> > > # This is unlikely, but if it's empty we can just<br>
> remove it<br>
> > > os.rmdir(srctreebase) @@ -1943,6 +1948,10 @@ def<br>
> > > _reset(recipes, no_clean, config, basepath, workspace):<br>
> > > def reset(args, config, basepath, workspace):<br>
> > > """Entry point for the devtool 'reset' subcommand"""<br>
> > > import bb<br>
> > > + import shutil<br>
> > > +<br>
> > > + recipes = ""<br>
> > > +<br>
> > > if args.recipename:<br>
> > > if args.all:<br>
> > > raise DevtoolError("Recipe cannot be specified if<br>
> > > -a/--all is used") @@ -1957,7 +1966,7 @@ def reset(args, config,<br>
> basepath,<br>
> > workspace):<br>
> > > else:<br>
> > > recipes = args.recipename<br>
> > ><br>
> > > - _reset(recipes, args.no_clean, config, basepath, workspace)<br>
> > > + _reset(recipes, args.no_clean, args.remove_work, config,<br>
> > > + basepath, workspace)<br>
> > ><br>
> > > return 0<br>
> > ><br>
> > > @@ -2009,6 +2018,7 @@ def finish(args, config, basepath,<br>
> workspace):<br>
> > > raise DevtoolError('Source tree is not<br>
> > > clean:\n\n%s\nEnsure you have committed your changes or use -f/--<br>
> force<br>
> > > if you are sure there\'s nothing that needs to be committed' %<br>
> dirty)<br>
> > ><br>
> > > no_clean = args.no_clean<br>
> > > + remove_work=args.remove_work<br>
> > > tinfoil = setup_tinfoil(basepath=basepath, tracking=True)<br>
> > > try:<br>
> > > rd = parse_recipe(config, tinfoil, args.recipename, True)<br>
> @@<br>
> > > -2160,7 +2170,7 @@ def finish(args, config, basepath, workspace):<br>
> > > if args.dry_run:<br>
> > > <a href="http://logger.info" rel="noreferrer" target="_blank">logger.info</a>('Resetting recipe (dry-run)')<br>
> > > else:<br>
> > > - _reset([args.recipename], no_clean=no_clean,<br>
> config=config,<br>
> > basepath=basepath, workspace=workspace)<br>
> > > + _reset([args.recipename], no_clean=no_clean,<br>
> > > + remove_work=remove_work, config=config, basepath=basepath,<br>
> > > + workspace=workspace)<br>
> > ><br>
> > > return 0<br>
> > ><br>
> > > @@ -2272,6 +2282,7 @@ def register_commands(subparsers, context):<br>
> > > parser_reset.add_argument('recipename', nargs='*',<br>
> help='Recipe to<br>
> > reset')<br>
> > > parser_reset.add_argument('--all', '-a', action="store_true",<br>
> help='Reset all<br>
> > recipes (clear workspace)')<br>
> > > parser_reset.add_argument('--no-clean', '-n',<br>
> > > action="store_true", help='Don\'t clean the sysroot to remove<br>
> recipe<br>
> > > output')<br>
> > > + parser_reset.add_argument('--remove-work', '-r',<br>
> > > + action="store_true", help='Clean the sources directory along with<br>
> > > + append')<br>
> > > parser_reset.set_defaults(func=reset)<br>
> > ><br>
> > > parser_finish = subparsers.add_parser('finish', help='Finish<br>
> > > working on a recipe in your workspace', @@ -2282,6 +2293,7 @@ def<br>
> > register_commands(subparsers, context):<br>
> > > parser_finish.add_argument('--mode', '-m', choices=['patch',<br>
> 'srcrev',<br>
> > 'auto'], default='auto', help='Update mode (where %(metavar)s is<br>
> %(choices)s;<br>
> > default is %(default)s)', metavar='MODE')<br>
> > > parser_finish.add_argument('--initial-rev', help='Override<br>
> starting revision<br>
> > for patches')<br>
> > > parser_finish.add_argument('--force', '-f',<br>
> action="store_true",<br>
> > > help='Force continuing even if there are uncommitted changes in the<br>
> > > source tree repository')<br>
> > > + parser_finish.add_argument('--remove-work', '-r',<br>
> > > + action="store_true", help='Clean the sources directory under<br>
> > > + workspace')<br>
> > > parser_finish.add_argument('--no-clean', '-n',<br>
> action="store_true",<br>
> > help='Don\'t clean the sysroot to remove recipe output')<br>
> > > parser_finish.add_argument('--no-overrides', '-O',<br>
> action="store_true",<br>
> > help='Do not handle other override branches (if they exist)')<br>
> > > parser_finish.add_argument('--dry-run', '-N',<br>
> > > action="store_true", help='Dry-run (just report changes instead of<br>
> > > writing them)')<br>
> > > --<br>
> > > 2.7.4<br>
> > ><br>
> <br>
> Thanks,<br>
> Chandana<br>
<br>
//Peter<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div></div>