summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/utilcmds.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool/utilcmds.py')
-rw-r--r--scripts/lib/devtool/utilcmds.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/scripts/lib/devtool/utilcmds.py b/scripts/lib/devtool/utilcmds.py
index b74511643f..7cd139fb8b 100644
--- a/scripts/lib/devtool/utilcmds.py
+++ b/scripts/lib/devtool/utilcmds.py
@@ -32,6 +32,12 @@ logger = logging.getLogger('devtool')
32 32
33def _find_recipe_path(args, config, basepath, workspace): 33def _find_recipe_path(args, config, basepath, workspace):
34 if args.any_recipe: 34 if args.any_recipe:
35 logger.warning('-a/--any-recipe option is now always active, and thus the option will be removed in a future release')
36 if args.recipename in workspace:
37 recipefile = workspace[args.recipename]['recipefile']
38 else:
39 recipefile = None
40 if not recipefile:
35 tinfoil = setup_tinfoil(config_only=False, basepath=basepath) 41 tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
36 try: 42 try:
37 rd = parse_recipe(config, tinfoil, args.recipename, True) 43 rd = parse_recipe(config, tinfoil, args.recipename, True)
@@ -40,12 +46,6 @@ def _find_recipe_path(args, config, basepath, workspace):
40 recipefile = rd.getVar('FILE') 46 recipefile = rd.getVar('FILE')
41 finally: 47 finally:
42 tinfoil.shutdown() 48 tinfoil.shutdown()
43 else:
44 check_workspace_recipe(workspace, args.recipename)
45 recipefile = workspace[args.recipename]['recipefile']
46 if not recipefile:
47 raise DevtoolError("Recipe file for %s is not under the workspace" %
48 args.recipename)
49 return recipefile 49 return recipefile
50 50
51 51
@@ -222,19 +222,21 @@ The ./configure %s output for %s follows.
222 222
223def register_commands(subparsers, context): 223def register_commands(subparsers, context):
224 """Register devtool subcommands from this plugin""" 224 """Register devtool subcommands from this plugin"""
225 parser_edit_recipe = subparsers.add_parser('edit-recipe', help='Edit a recipe file in your workspace', 225 parser_edit_recipe = subparsers.add_parser('edit-recipe', help='Edit a recipe file',
226 description='Runs the default editor (as specified by the EDITOR variable) on the specified recipe. Note that the recipe file itself must be in the workspace (i.e. as a result of "devtool add" or "devtool upgrade"); you can override this with the -a/--any-recipe option.', 226 description='Runs the default editor (as specified by the EDITOR variable) on the specified recipe. Note that this will be quicker for recipes in the workspace as the cache does not need to be loaded in that case.',
227 group='working') 227 group='working')
228 parser_edit_recipe.add_argument('recipename', help='Recipe to edit') 228 parser_edit_recipe.add_argument('recipename', help='Recipe to edit')
229 parser_edit_recipe.add_argument('--any-recipe', '-a', action="store_true", help='Edit any recipe, not just where the recipe file itself is in the workspace') 229 # FIXME drop -a at some point in future
230 parser_edit_recipe.add_argument('--any-recipe', '-a', action="store_true", help='Does nothing (exists for backwards-compatibility)')
230 parser_edit_recipe.set_defaults(func=edit_recipe) 231 parser_edit_recipe.set_defaults(func=edit_recipe)
231 232
232 # Find-recipe 233 # Find-recipe
233 parser_find_recipe = subparsers.add_parser('find-recipe', help='Find a recipe file in your workspace', 234 parser_find_recipe = subparsers.add_parser('find-recipe', help='Find a recipe file',
234 description='By default, this will find a recipe file in your workspace; you can override this with the -a/--any-recipe option.', 235 description='Finds a recipe file. Note that this will be quicker for recipes in the workspace as the cache does not need to be loaded in that case.',
235 group='working') 236 group='working')
236 parser_find_recipe.add_argument('recipename', help='Recipe to find') 237 parser_find_recipe.add_argument('recipename', help='Recipe to find')
237 parser_find_recipe.add_argument('--any-recipe', '-a', action="store_true", help='Find any recipe, not just where the recipe file itself is in the workspace') 238 # FIXME drop -a at some point in future
239 parser_find_recipe.add_argument('--any-recipe', '-a', action="store_true", help='Does nothing (exists for backwards-compatibility)')
238 parser_find_recipe.set_defaults(func=find_recipe) 240 parser_find_recipe.set_defaults(func=find_recipe)
239 241
240 # NOTE: Needed to override the usage string here since the default 242 # NOTE: Needed to override the usage string here since the default