]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: prevent BBHandledException from showing traceback
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 13 Dec 2016 07:09:44 +0000 (20:09 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 14 Dec 2016 09:56:36 +0000 (09:56 +0000)
If we don't catch this then attempting to run devtool in non-memres mode
when bitbake is already running will produce a traceback instead of just
an error message.

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

index 219749365cae6d1230b728cfda44f1c0c638fdf0..578db5a68b941289db2fe793517b1b254efef343 100755 (executable)
@@ -288,11 +288,14 @@ def main():
     scriptutils.logger_setup_color(logger, global_args.color)
 
     if global_args.bbpath is None:
-        tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
         try:
-            global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True)
-        finally:
-            tinfoil.shutdown()
+            tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+            try:
+                global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True)
+            finally:
+                tinfoil.shutdown()
+        except bb.BBHandledException:
+            return 2
 
     # Search BBPATH first to allow layers to override plugins in scripts_path
     for path in global_args.bbpath.split(':') + [scripts_path]: