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