diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-02-23 17:38:07 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-23 22:52:15 +0000 |
commit | ebc0d4252a19e6ab38052473e54138d29b172dfc (patch) | |
tree | 752ea71cc8bc9ca72fa2d382d1255b2e1ebbd307 /bitbake/lib | |
parent | 4a1c163b55a399d3a6cb0bedec0ee23ce3128313 (diff) | |
download | poky-ebc0d4252a19e6ab38052473e54138d29b172dfc.tar.gz |
bitbake: fix parse errors not being reported
Fixes a regression introduced in BitBake rev
c9f58ef6b897d3fa5b0d23734b5f2cb3dabb057a which prevents errors during
parsing from being fully reported because BitBake shuts down before it
can print them. Move the error printing to before the shutdown in order
to fix it.
Also remove a couple of superfluous calls to sys.exit() since these
will never be called (as self.shutdown(clean=False) does this itself).
(Bitbake rev: 356c42ed00541dea2c382c57f768a4f431d22db0)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index f0778e5a46..308805a712 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1605,22 +1605,20 @@ class CookerParser(object): | |||
1605 | self.shutdown() | 1605 | self.shutdown() |
1606 | return False | 1606 | return False |
1607 | except ParsingFailure as exc: | 1607 | except ParsingFailure as exc: |
1608 | self.shutdown(clean=False) | 1608 | logger.error('Unable to parse %s: %s' % |
1609 | bb.fatal('Unable to parse %s: %s' % | ||
1610 | (exc.recipe, bb.exceptions.to_string(exc.realexception))) | 1609 | (exc.recipe, bb.exceptions.to_string(exc.realexception))) |
1610 | self.shutdown(clean=False) | ||
1611 | except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc: | 1611 | except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc: |
1612 | logger.error(str(exc)) | ||
1612 | self.shutdown(clean=False) | 1613 | self.shutdown(clean=False) |
1613 | bb.fatal(str(exc)) | ||
1614 | except SyntaxError as exc: | 1614 | except SyntaxError as exc: |
1615 | self.shutdown(clean=False) | ||
1616 | logger.error('Unable to parse %s', exc.recipe) | 1615 | logger.error('Unable to parse %s', exc.recipe) |
1617 | sys.exit(1) | 1616 | self.shutdown(clean=False) |
1618 | except Exception as exc: | 1617 | except Exception as exc: |
1619 | etype, value, tb = sys.exc_info() | 1618 | etype, value, tb = sys.exc_info() |
1620 | logger.error('Unable to parse %s', value.recipe, | 1619 | logger.error('Unable to parse %s', value.recipe, |
1621 | exc_info=(etype, value, exc.traceback)) | 1620 | exc_info=(etype, value, exc.traceback)) |
1622 | self.shutdown(clean=False) | 1621 | self.shutdown(clean=False) |
1623 | sys.exit(1) | ||
1624 | 1622 | ||
1625 | self.current += 1 | 1623 | self.current += 1 |
1626 | self.virtuals += len(result) | 1624 | self.virtuals += len(result) |