* [PATCH v2] devtool: add clean command
@ 2017-10-26 7:22 Josef Holzmayr
2017-10-26 14:28 ` Leonardo Sandoval
0 siblings, 1 reply; 3+ messages in thread
From: Josef Holzmayr @ 2017-10-26 7:22 UTC (permalink / raw)
To: paul.eggleton; +Cc: yocto
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3295 bytes --]
Add an idiomatic way to devtool to clean a recipe. When using devtool
in the context of an eSDK there is no direct access to bitbake.
This command exposes the bitbake clean facility through devtool,
keeping the idiomatic interface and configurability.
Signed-off-by: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de>
---
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 0000000000..473c30f366
--- /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_clean_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_clean_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)
--
2.14.3
--
_____________________________________________________________
R-S-I Elektrotechnik GmbH & Co. KG
Woelkestrasse 11
D-85301 Schweitenkirchen
Fon: +49 8444 9204-0
Fax: +49 8444 9204-50
www.rsi-elektrotechnik.de
_____________________________________________________________
Amtsgericht Ingolstadt - GmbH: HRB 191328 - KG: HRA 170363
Geschäftsführer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg
USt-IdNr.: DE 128592548
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] devtool: add clean command
2017-10-26 7:22 [PATCH v2] devtool: add clean command Josef Holzmayr
@ 2017-10-26 14:28 ` Leonardo Sandoval
0 siblings, 0 replies; 3+ messages in thread
From: Leonardo Sandoval @ 2017-10-26 14:28 UTC (permalink / raw)
To: Josef Holzmayr; +Cc: paul.eggleton, yocto
[-- Attachment #1: Type: text/plain, Size: 3983 bytes --]
Josef, as Paul mentioned, this is a openembedded-core patch and should
be sent to the proper mailing list.
Great that you included the reason of this patch on the description,
otherwise I saw no real benefit from this change.
Leo
On Thu, Oct 26, 2017 at 2:22 AM, Josef Holzmayr
<holzmayr@rsi-elektrotechnik.de> wrote:
> Add an idiomatic way to devtool to clean a recipe. When using devtool
> in the context of an eSDK there is no direct access to bitbake.
> This command exposes the bitbake clean facility through devtool,
> keeping the idiomatic interface and configurability.
>
> Signed-off-by: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de>
> ---
> 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 0000000000..473c30f366
> --- /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_clean_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_clean_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)
> --
> 2.14.3
>
>
> --
> _____________________________________________________________
> R-S-I Elektrotechnik GmbH & Co. KG
> Woelkestrasse 11
> D-85301 Schweitenkirchen
> Fon: +49 8444 9204-0
> Fax: +49 8444 9204-50
> www.rsi-elektrotechnik.de
>
> _____________________________________________________________
> Amtsgericht Ingolstadt - GmbH: HRB 191328 - KG: HRA 170363
> Geschftsfhrer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg
> USt-IdNr.: DE 128592548
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
[-- Attachment #2: Type: text/html, Size: 4250 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] devtool: add clean command
@ 2017-10-29 18:34 Josef Holzmayr
0 siblings, 0 replies; 3+ messages in thread
From: Josef Holzmayr @ 2017-10-29 18:34 UTC (permalink / raw)
To: openembedded-core; +Cc: paul.eggleton
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3295 bytes --]
Add an idiomatic way to devtool to clean a recipe. When using devtool
in the context of an eSDK there is no direct access to bitbake.
This command exposes the bitbake clean facility through devtool,
keeping the idiomatic interface and configurability.
Signed-off-by: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de>
---
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 0000000000..473c30f366
--- /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_clean_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_clean_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)
--
2.14.3
--
_____________________________________________________________
R-S-I Elektrotechnik GmbH & Co. KG
Woelkestrasse 11
D-85301 Schweitenkirchen
Fon: +49 8444 9204-0
Fax: +49 8444 9204-50
www.rsi-elektrotechnik.de
_____________________________________________________________
Amtsgericht Ingolstadt - GmbH: HRB 191328 - KG: HRA 170363
Geschäftsführer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg
USt-IdNr.: DE 128592548
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-29 18:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-26 7:22 [PATCH v2] devtool: add clean command Josef Holzmayr
2017-10-26 14:28 ` Leonardo Sandoval
-- strict thread matches above, loose matches on Subject: below --
2017-10-29 18:34 Josef Holzmayr
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.