summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/devtool/utilcmds.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/lib/devtool/utilcmds.py b/scripts/lib/devtool/utilcmds.py
index c8cb760e4b..b74511643f 100644
--- a/scripts/lib/devtool/utilcmds.py
+++ b/scripts/lib/devtool/utilcmds.py
@@ -30,14 +30,13 @@ from devtool import parse_recipe
30 30
31logger = logging.getLogger('devtool') 31logger = logging.getLogger('devtool')
32 32
33def find_recipe(args, config, basepath, workspace): 33def _find_recipe_path(args, config, basepath, workspace):
34 """Entry point for the devtool 'find-recipe' subcommand"""
35 if args.any_recipe: 34 if args.any_recipe:
36 tinfoil = setup_tinfoil(config_only=False, basepath=basepath) 35 tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
37 try: 36 try:
38 rd = parse_recipe(config, tinfoil, args.recipename, True) 37 rd = parse_recipe(config, tinfoil, args.recipename, True)
39 if not rd: 38 if not rd:
40 return 1 39 raise DevtoolError("Failed to find specified recipe")
41 recipefile = rd.getVar('FILE') 40 recipefile = rd.getVar('FILE')
42 finally: 41 finally:
43 tinfoil.shutdown() 42 tinfoil.shutdown()
@@ -47,11 +46,19 @@ def find_recipe(args, config, basepath, workspace):
47 if not recipefile: 46 if not recipefile:
48 raise DevtoolError("Recipe file for %s is not under the workspace" % 47 raise DevtoolError("Recipe file for %s is not under the workspace" %
49 args.recipename) 48 args.recipename)
49 return recipefile
50
51
52def find_recipe(args, config, basepath, workspace):
53 """Entry point for the devtool 'find-recipe' subcommand"""
54 recipefile = _find_recipe_path(args, config, basepath, workspace)
55 print(recipefile)
56 return 0
50 57
51 58
52def edit_recipe(args, config, basepath, workspace): 59def edit_recipe(args, config, basepath, workspace):
53 """Entry point for the devtool 'edit-recipe' subcommand""" 60 """Entry point for the devtool 'edit-recipe' subcommand"""
54 return scriptutils.run_editor(find_recipe(args, config, basepath, workspace), logger) 61 return scriptutils.run_editor(_find_recipe_path(args, config, basepath, workspace), logger)
55 62
56 63
57def configure_help(args, config, basepath, workspace): 64def configure_help(args, config, basepath, workspace):