[oe-commits] [openembedded-core] 04/18: devtool: edit-recipe: fix regression

git at git.openembedded.org git at git.openembedded.org
Thu Aug 31 22:30:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit d5191840212adbf480961ba6fc68e1ab17e5a77a
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Thu Aug 31 11:54:09 2017 +1200

    devtool: edit-recipe: fix regression
    
    OE-Core commit 5a16b3c804c5eca331a1c08a7ce31a54909af105 attempted to use
    the same function to get the path to a recipe as the new "find-recipe"
    command it implemented, except that cannot work because (a) it didn't
    return anything and (b) event if it had tried, a command function can
    only return an exit code and we don't want that for find-recipe if it
    succeeded. Split out a separate reusable function for both commands.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/devtool/utilcmds.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/devtool/utilcmds.py b/scripts/lib/devtool/utilcmds.py
index c8cb760..b745116 100644
--- a/scripts/lib/devtool/utilcmds.py
+++ b/scripts/lib/devtool/utilcmds.py
@@ -30,14 +30,13 @@ from devtool import parse_recipe
 
 logger = logging.getLogger('devtool')
 
-def find_recipe(args, config, basepath, workspace):
-    """Entry point for the devtool 'find-recipe' subcommand"""
+def _find_recipe_path(args, config, basepath, workspace):
     if args.any_recipe:
         tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
         try:
             rd = parse_recipe(config, tinfoil, args.recipename, True)
             if not rd:
-                return 1
+                raise DevtoolError("Failed to find specified recipe")
             recipefile = rd.getVar('FILE')
         finally:
             tinfoil.shutdown()
@@ -47,11 +46,19 @@ def find_recipe(args, config, basepath, workspace):
         if not recipefile:
             raise DevtoolError("Recipe file for %s is not under the workspace" %
                                args.recipename)
+    return recipefile
+
+
+def find_recipe(args, config, basepath, workspace):
+    """Entry point for the devtool 'find-recipe' subcommand"""
+    recipefile = _find_recipe_path(args, config, basepath, workspace)
+    print(recipefile)
+    return 0
 
 
 def edit_recipe(args, config, basepath, workspace):
     """Entry point for the devtool 'edit-recipe' subcommand"""
-    return scriptutils.run_editor(find_recipe(args, config, basepath, workspace), logger)
+    return scriptutils.run_editor(_find_recipe_path(args, config, basepath, workspace), logger)
 
 
 def configure_help(args, config, basepath, workspace):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list