From 90cba7992bc1d227e242666cd486414bd4a45f7e Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Sun, 11 Oct 2015 16:13:18 +0100 Subject: devtool: disable creating workspace for extract and search subcommands For subcommands that don't actually involve the workspace, don't auto-create the workspace. Signed-off-by: Paul Eggleton Signed-off-by: Ross Burton --- scripts/devtool | 4 ++-- scripts/lib/devtool/search.py | 2 +- scripts/lib/devtool/standard.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/devtool b/scripts/devtool index e4d9db301a..2a5a3d41c1 100755 --- a/scripts/devtool +++ b/scripts/devtool @@ -261,7 +261,7 @@ def main(): description='Sets up a new workspace. NOTE: other devtool subcommands will create a workspace automatically as needed, so you only need to use %(prog)s if you want to specify where the workspace should be located.') parser_create_workspace.add_argument('layerpath', nargs='?', help='Path in which the workspace layer should be created') parser_create_workspace.add_argument('--create-only', action="store_true", help='Only create the workspace layer, do not alter configuration') - parser_create_workspace.set_defaults(func=create_workspace) + parser_create_workspace.set_defaults(func=create_workspace, no_workspace=True) for plugin in plugins: if hasattr(plugin, 'register_commands'): @@ -269,7 +269,7 @@ def main(): args = parser.parse_args(unparsed_args, namespace=global_args) - if args.subparser_name != 'create-workspace': + if not getattr(args, 'no_workspace', False): read_workspace() try: diff --git a/scripts/lib/devtool/search.py b/scripts/lib/devtool/search.py index c2f420c33c..1c8eaff49b 100644 --- a/scripts/lib/devtool/search.py +++ b/scripts/lib/devtool/search.py @@ -77,4 +77,4 @@ def register_commands(subparsers, context): parser_search = subparsers.add_parser('search', help='Search available recipes', description='Searches for available target recipes. Matches on recipe name, package name, description and installed files, and prints the recipe name on match.') parser_search.add_argument('keyword', help='Keyword to search for (regular expression syntax allowed)') - parser_search.set_defaults(func=search) + parser_search.set_defaults(func=search, no_workspace=True) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 9fd936f146..6de24eb524 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -1166,7 +1166,7 @@ def register_commands(subparsers, context): parser_extract.add_argument('srctree', help='Path to where to extract the source tree') parser_extract.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout') parser_extract.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)') - parser_extract.set_defaults(func=extract) + parser_extract.set_defaults(func=extract, no_workspace=True) parser_sync = subparsers.add_parser('sync', help='Synchronize the source for an existing recipe', description='Synchronize the source for an existing recipe', -- cgit v1.2.3