]> 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)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 8 Jun 2011 19:38:24 +0000 (20:38 +0100)
(Bitbake rev: a41c217c6e9195f8b9ea2de6e1d335b10b904558)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/cooker.py

index fab65c22d5b5b173a786811f67c02d9da8141068..ef42f02dabc7a70e04433291e01434270b844a99 100644 (file)
@@ -33,7 +33,7 @@ import sre_constants
 import threading
 from cStringIO import StringIO
 from contextlib import closing
-import bb
+import bb, bb.exceptions
 from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue
 
 logger      = logging.getLogger("BitBake")
@@ -1122,8 +1122,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, caches_array = task
@@ -1216,6 +1215,10 @@ class CookerParser(object):
         except KeyboardInterrupt:
             self.shutdown(clean=False)
             raise
+        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))