diff options
| -rw-r--r-- | bitbake/lib/bb/build.py | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 249f7d6bb4..c4c8aeb645 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
| @@ -565,24 +565,32 @@ def _exec_task(fn, task, d, quieterr): | |||
| 565 | 565 | ||
| 566 | flags = localdata.getVarFlags(task) | 566 | flags = localdata.getVarFlags(task) |
| 567 | 567 | ||
| 568 | event.fire(TaskStarted(task, logfn, flags, localdata), localdata) | ||
| 569 | try: | 568 | try: |
| 570 | for func in (prefuncs or '').split(): | 569 | try: |
| 571 | exec_func(func, localdata) | 570 | event.fire(TaskStarted(task, logfn, flags, localdata), localdata) |
| 572 | exec_func(task, localdata) | 571 | except (bb.BBHandledException, SystemExit): |
| 573 | for func in (postfuncs or '').split(): | 572 | return 1 |
| 574 | exec_func(func, localdata) | 573 | except FuncFailed as exc: |
| 575 | except FuncFailed as exc: | ||
| 576 | if quieterr: | ||
| 577 | event.fire(TaskFailedSilent(task, logfn, localdata), localdata) | ||
| 578 | else: | ||
| 579 | errprinted = errchk.triggered | ||
| 580 | logger.error(str(exc)) | 574 | logger.error(str(exc)) |
| 581 | event.fire(TaskFailed(task, logfn, localdata, errprinted), localdata) | 575 | return 1 |
| 582 | return 1 | 576 | |
| 583 | except bb.BBHandledException: | 577 | try: |
| 584 | event.fire(TaskFailed(task, logfn, localdata, True), localdata) | 578 | for func in (prefuncs or '').split(): |
| 585 | return 1 | 579 | exec_func(func, localdata) |
| 580 | exec_func(task, localdata) | ||
| 581 | for func in (postfuncs or '').split(): | ||
| 582 | exec_func(func, localdata) | ||
| 583 | except FuncFailed as exc: | ||
| 584 | if quieterr: | ||
| 585 | event.fire(TaskFailedSilent(task, logfn, localdata), localdata) | ||
| 586 | else: | ||
| 587 | errprinted = errchk.triggered | ||
| 588 | logger.error(str(exc)) | ||
| 589 | event.fire(TaskFailed(task, logfn, localdata, errprinted), localdata) | ||
| 590 | return 1 | ||
| 591 | except bb.BBHandledException: | ||
| 592 | event.fire(TaskFailed(task, logfn, localdata, True), localdata) | ||
| 593 | return 1 | ||
| 586 | finally: | 594 | finally: |
| 587 | sys.stdout.flush() | 595 | sys.stdout.flush() |
| 588 | sys.stderr.flush() | 596 | sys.stderr.flush() |
