]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
devtool: extract: fix error handling
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 14 Oct 2015 15:43:24 +0000 (16:43 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 19 Oct 2015 16:48:34 +0000 (17:48 +0100)
If recipe parsing fails we need to exit out instead of attempting to use
the data object that's set to None, which resulted in a traceback.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/devtool/standard.py

index 6ce3144dd0335dc4562c9af45e85c17fc1085470..5d7e903670d7d4d68427a2e0f62983c9991786bf 100644 (file)
@@ -225,6 +225,9 @@ def extract(args, config, basepath, workspace):
     import bb
 
     tinfoil = _prep_extract_operation(config, basepath, args.recipename)
+    if not tinfoil:
+        # Error already shown
+        return 1
 
     rd = parse_recipe(config, tinfoil, args.recipename, True)
     if not rd:
@@ -271,6 +274,8 @@ def _prep_extract_operation(config, basepath, recipename):
        trying to extract a package. Returns the tinfoil instance to be used."""
     tinfoil = setup_tinfoil(basepath=basepath)
     rd = parse_recipe(config, tinfoil, recipename, True)
+    if not rd:
+        return None
 
     if bb.data.inherits_class('kernel-yocto', rd):
         tinfoil.shutdown()
@@ -500,6 +505,9 @@ def modify(args, config, basepath, workspace):
                            args.srctree)
     if args.extract:
         tinfoil = _prep_extract_operation(config, basepath, args.recipename)
+        if not tinfoil:
+            # Error already shown
+            return 1
     else:
         tinfoil = setup_tinfoil(basepath=basepath)