]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
cooker: show a useful message for ParsingFailure
authorChris Larson <chris_larson@mentor.com>
Thu, 5 May 2011 23:50:34 +0000 (16:50 -0700)
committerChris Larson <chris_larson@mentor.com>
Mon, 16 May 2011 19:39:42 +0000 (12:39 -0700)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
lib/bb/cooker.py

index 06912bde65e36b4cbf72192160ba7ce7524cafb8..95b5db91f358efec4f2ce84439e5c59d957db34a 100644 (file)
@@ -33,7 +33,7 @@ import threading
 from cStringIO import StringIO
 from contextlib import closing
 from functools import wraps
-import bb
+import bb, bb.exceptions
 from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue
 
 logger      = logging.getLogger("BitBake")
@@ -1019,8 +1019,7 @@ class ParsingFailure(Exception):
     def __init__(self, realexception, recipe):
         self.realexception = realexception
         self.recipe = recipe
-        Exception.__init__(self, "Failure when parsing %s" % recipe)
-        self.args = (realexception, recipe)
+        Exception.__init__(self, realexception, recipe)
 
 def parse_file(task):
     filename, appends = task
@@ -1116,6 +1115,10 @@ class CookerParser(object):
         except StopIteration:
             self.shutdown()
             return False
+        except ParsingFailure as exc:
+            self.shutdown(clean=False)
+            bb.fatal('Error parsing %s: %s' %
+                     (exc.recipe, bb.exceptions.to_string(exc.realexception)))
         except Exception as exc:
             self.shutdown(clean=False)
             bb.fatal('Error parsing %s: %s' % (exc.recipe, exc))