Patchwork [bitbake-devel,3/5] cooker: report recipe being parsed when ExpansionError occurs

login
register
mail settings
Submitter Paul Eggleton
Date May 30, 2012, 4:17 p.m.
Message ID <de19740da25500a792b882f0282033b48e61fa19.1338394341.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/28959/
State New
Headers show

Comments

Paul Eggleton - May 30, 2012, 4:17 p.m.
When an ExpansionError occurs during parsing it is useful to know which
recipe was being parsed when it occurred.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/cooker.py |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index b30945c..928b600 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1657,9 +1657,13 @@  class CookerParser(object):
             logger.error('Unable to parse %s: %s' %
                      (exc.recipe, bb.exceptions.to_string(exc.realexception)))
             self.shutdown(clean=False)
-        except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc:
+        except bb.parse.ParseError as exc:
             logger.error(str(exc))
             self.shutdown(clean=False)
+        except bb.data_smart.ExpansionError as exc:
+            _, value, _ = sys.exc_info()
+            logger.error('ExpansionError during parsing %s: %s', value.recipe, str(exc))
+            self.shutdown(clean=False)
         except SyntaxError as exc:
             logger.error('Unable to parse %s', exc.recipe)
             self.shutdown(clean=False)