Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/3] Minor devtool / recipetool fixes
@ 2016-06-13  4:43 Paul Eggleton
  2016-06-13  4:43 ` [PATCH 1/3] devtool: tweak README in created workspace layer Paul Eggleton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-06-13  4:43 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 2fdd2c1434e7c741b8048145bd460c68bea7ee53:

  systemtap: add build dependency on ncurses (2016-06-12 23:47:00 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/devtool17-oe
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/devtool17-oe

Paul Eggleton (3):
  devtool: tweak README in created workspace layer
  devtool: reset: allow specifying multiple recipes
  scripts: ensure not specifying subcommand shows help text

 scripts/contrib/devtool-stress.py |  1 +
 scripts/devtool                   | 12 ++++++++----
 scripts/lib/devtool/standard.py   |  9 +++++----
 scripts/recipetool                |  1 +
 4 files changed, 15 insertions(+), 8 deletions(-)

-- 
2.5.5



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] devtool: tweak README in created workspace layer
  2016-06-13  4:43 [PATCH 0/3] Minor devtool / recipetool fixes Paul Eggleton
@ 2016-06-13  4:43 ` Paul Eggleton
  2016-06-13  4:43 ` [PATCH 2/3] devtool: reset: allow specifying multiple recipes Paul Eggleton
  2016-06-13  4:43 ` [PATCH 3/3] scripts: ensure not specifying subcommand shows help text Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-06-13  4:43 UTC (permalink / raw)
  To: openembedded-core

Clarify slightly the intended usage of the workspace layer.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/devtool | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/scripts/devtool b/scripts/devtool
index ff368dc..63d2ef9 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -179,13 +179,16 @@ def _create_workspace(workspacedir, config, basepath):
         # Add a README file
         with open(os.path.join(workspacedir, 'README'), 'w') as f:
             f.write('This layer was created by the OpenEmbedded devtool utility in order to\n')
-            f.write('contain recipes and bbappends. In most instances you should use the\n')
+            f.write('contain recipes and bbappends that are currently being worked on. The idea\n')
+            f.write('is that the contents is temporary - once you have finished working on a\n')
+            f.write('recipe you use the appropriate method to move the files you have been\n')
+            f.write('working on to a proper layer. In most instances you should use the\n')
             f.write('devtool utility to manage files within it rather than modifying files\n')
             f.write('directly (although recipes added with "devtool add" will often need\n')
             f.write('direct modification.)\n')
-            f.write('\nIf you no longer need to use devtool you can remove the path to this\n')
-            f.write('workspace layer from your conf/bblayers.conf file (and then delete the\n')
-            f.write('layer, if you wish).\n')
+            f.write('\nIf you no longer need to use devtool or the workspace layer\'s contents\n')
+            f.write('you can remove the path to this workspace layer from your conf/bblayers.conf')
+            f.write('file (and then delete the layer, if you wish).\n')
             f.write('\nNote that by default, if devtool fetches and unpacks source code, it\n')
             f.write('will place it in a subdirectory of a "sources" subdirectory of the\n')
             f.write('layer. If you prefer it to be elsewhere you can specify the source\n')
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] devtool: reset: allow specifying multiple recipes
  2016-06-13  4:43 [PATCH 0/3] Minor devtool / recipetool fixes Paul Eggleton
  2016-06-13  4:43 ` [PATCH 1/3] devtool: tweak README in created workspace layer Paul Eggleton
@ 2016-06-13  4:43 ` Paul Eggleton
  2016-06-13  4:43 ` [PATCH 3/3] scripts: ensure not specifying subcommand shows help text Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-06-13  4:43 UTC (permalink / raw)
  To: openembedded-core

Allow specifying more than one recipe on the devtool reset command line.

Also tweak the help text slightly.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/lib/devtool/standard.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index a2516d6..ed49a93 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1304,14 +1304,15 @@ def reset(args, config, basepath, workspace):
         if args.all:
             raise DevtoolError("Recipe cannot be specified if -a/--all is used")
         else:
-            check_workspace_recipe(workspace, args.recipename, checksrc=False)
+            for recipe in args.recipename:
+                check_workspace_recipe(workspace, recipe, checksrc=False)
     elif not args.all:
         raise DevtoolError("Recipe must be specified, or specify -a/--all to "
                            "reset all recipes")
     if args.all:
         recipes = list(workspace.keys())
     else:
-        recipes = [args.recipename]
+        recipes = args.recipename
 
     if recipes and not args.no_clean:
         if len(recipes) == 1:
@@ -1449,9 +1450,9 @@ def register_commands(subparsers, context):
     parser_status.set_defaults(func=status)
 
     parser_reset = subparsers.add_parser('reset', help='Remove a recipe from your workspace',
-                                         description='Removes the specified recipe from your workspace (resetting its state)',
+                                         description='Removes the specified recipe(s) from your workspace (resetting its state back to that defined by the metadata).',
                                          group='working', order=-100)
-    parser_reset.add_argument('recipename', nargs='?', help='Recipe to reset')
+    parser_reset.add_argument('recipename', nargs='*', help='Recipe to reset')
     parser_reset.add_argument('--all', '-a', action="store_true", help='Reset all recipes (clear workspace)')
     parser_reset.add_argument('--no-clean', '-n', action="store_true", help='Don\'t clean the sysroot to remove recipe output')
     parser_reset.set_defaults(func=reset)
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] scripts: ensure not specifying subcommand shows help text
  2016-06-13  4:43 [PATCH 0/3] Minor devtool / recipetool fixes Paul Eggleton
  2016-06-13  4:43 ` [PATCH 1/3] devtool: tweak README in created workspace layer Paul Eggleton
  2016-06-13  4:43 ` [PATCH 2/3] devtool: reset: allow specifying multiple recipes Paul Eggleton
@ 2016-06-13  4:43 ` Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-06-13  4:43 UTC (permalink / raw)
  To: openembedded-core

With Python 2, argparse subparsers behaviour in Python 2 was to print
the usage information if the subparsers argument wasn't specified.
However, with Python 3.2.3 and later a subparsers argument is not
required by default, leading to errors when no arguments are specified:

  AttributeError: 'Namespace' object has no attribute 'func'

Restore the previous desired behaviour of showing the help text for
devtool, recipetool and the devtool-stress script by setting
subparsers.required to True.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/contrib/devtool-stress.py | 1 +
 scripts/devtool                   | 1 +
 scripts/recipetool                | 1 +
 3 files changed, 3 insertions(+)

diff --git a/scripts/contrib/devtool-stress.py b/scripts/contrib/devtool-stress.py
index 2723491..ab77a2d 100755
--- a/scripts/contrib/devtool-stress.py
+++ b/scripts/contrib/devtool-stress.py
@@ -213,6 +213,7 @@ def main():
     parser.add_argument('-s', '--skip', help='Skip specified recipes (comma-separated without spaces, wildcards allowed)', metavar='PNLIST')
     parser.add_argument('-c', '--skip-classes', help='Skip recipes inheriting specified classes (comma-separated) - default %(default)s', metavar='CLASSLIST', default='native,nativesdk,cross,cross-canadian,image,populate_sdk,meta,packagegroup')
     subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>')
+    subparsers.required = True
 
     parser_modify = subparsers.add_parser('modify',
                                           help='Run "devtool modify" followed by a build with bitbake on matching recipes',
diff --git a/scripts/devtool b/scripts/devtool
index 63d2ef9..a93a11f 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -301,6 +301,7 @@ def main():
         tinfoil.shutdown()
 
     subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>')
+    subparsers.required = True
 
     subparsers.add_subparser_group('sdk', 'SDK maintenance', -2)
     subparsers.add_subparser_group('advanced', 'Advanced', -1)
diff --git a/scripts/recipetool b/scripts/recipetool
index 0e8bffb..17233d4 100755
--- a/scripts/recipetool
+++ b/scripts/recipetool
@@ -60,6 +60,7 @@ def main():
     parser.add_argument('-h', '--help', action='help', default=argparse.SUPPRESS,
                         help='show this help message and exit')
     subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>')
+    subparsers.required = True
 
     if global_args.debug:
         logger.setLevel(logging.DEBUG)
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-13  4:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-13  4:43 [PATCH 0/3] Minor devtool / recipetool fixes Paul Eggleton
2016-06-13  4:43 ` [PATCH 1/3] devtool: tweak README in created workspace layer Paul Eggleton
2016-06-13  4:43 ` [PATCH 2/3] devtool: reset: allow specifying multiple recipes Paul Eggleton
2016-06-13  4:43 ` [PATCH 3/3] scripts: ensure not specifying subcommand shows help text Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox