<br><br>On Wed, Oct 25, 2017 at 7:20 AM, Josef Holzmayr <holzmayr@rsi-elektrotechnik.de> wrote:<br>
<blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">Add an idiomatic way to devtool to clean a recipe.
</div></blockquote><div><br></div><div>what I can see on the patch, this does a bitbake -c clean <recipename>, right? </div><br><blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">
Signed-off-by: Josef Holzmayr <<a href="mailto:holzmayr@rsi-elektrotechnik.de">holzmayr@rsi-elektrotechnik.de</a>>
---
scripts/lib/devtool/clean.py | 48 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100644 scripts/lib/devtool/clean.py
diff --git a/scripts/lib/devtool/clean.py b/scripts/lib/devtool/clean.py
new file mode 100644
index 0000000..30f4044
--- /dev/null
+++ b/scripts/lib/devtool/clean.py
@@ -0,0 +1,48 @@
+# Development tool - clean command plugin
+#
+# Copyright (C) 2014-2015 Intel Corporation
+# 2017 R-S-I Elektrotechnik GmbH & Co. KG
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""Devtool clean plugin"""
+
+import bb
+from devtool import exec_build_env_command, check_workspace_recipe
+
+def _get_build_tasks(config):
+ tasks = config.get('Clean', 'clean_task', 'clean').split(',')
+ return ['do_%s' % task.strip() for task in tasks]
+
+def clean(args, config, basepath, workspace):
+ """Entry point for the devtool 'clean' subcommand"""
+
+ build_tasks = _get_build_tasks(config)
+ try:
+ bbargs = []
+ for task in build_tasks:
+ bbargs.append('%s:%s' % (args.recipename, task))
+ exec_build_env_command(config.init_path, basepath, 'bitbake %s' % ' '.join(bbargs), watch=True)
+ except bb.process.ExecutionError as e:
+ # We've already seen the output since watch=True, so just ensure we return something to the user
+ return e.exitcode
+
+ return 0
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from this plugin"""
+ parser_build = subparsers.add_parser('clean', help='Clean a recipe',
+ description='Cleans the specified recipe using bitbake',
+ group='working', order=50)
+ parser_build.add_argument('recipename', help='Recipe to clean')
+ parser_build.set_defaults(func=clean)
<div>--
</div>2.7.4
<div>--
</div>_____________________________________________________________
R-S-I Elektrotechnik GmbH & Co. KG
Woelkestrasse 11
D-85301 Schweitenkirchen
Fon: +49 8444 9204-0
Fax: +49 8444 9204-50
<a href="http://www.rsi-elektrotechnik.de">www.rsi-elektrotechnik.de</a>
_____________________________________________________________
Amtsgericht Ingolstadt - GmbH: HRB 191328 - KG: HRA 170363
Geschftsfhrer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg
USt-IdNr.: DE 128592548
</div><div class="plaintext" style="white-space: pre-wrap;">--
_______________________________________________
yocto mailing list
<a href="mailto:yocto@yoctoproject.org">yocto@yoctoproject.org</a>
<a href="https://lists.yoctoproject.org/listinfo/yocto">https://lists.yoctoproject.org/listinfo/yocto</a>
</div></blockquote>