summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRob Woolley <rob.woolley@windriver.com>2015-02-27 09:32:22 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-16 17:41:28 +0000
commit0b5ab4d9873f21efead522284783e4be86a71c9f (patch)
tree6a6774b47da74e06b8a2a2129fe3a27fb5e8fff3 /bitbake
parent7f30749fe026e9ceb75d73b89271145a45a60763 (diff)
downloadast2050-yocto-poky-0b5ab4d9873f21efead522284783e4be86a71c9f.zip
ast2050-yocto-poky-0b5ab4d9873f21efead522284783e4be86a71c9f.tar.gz
bitbake: knotty: Catch exceptions on broken pipes
Any exceptions that occur in calls to logging methods are automatically suppressed, including exceptions due to broken pipes. However, the knotty summary messages are printed directly to stdout, which means that any broken pipes will cause an exception traceback in python. By wrapping the summary section in a try / catch block we can check for IOError exceptions caused by broken pipes and let them pass. (Bitbake rev: 146e7e157f97b676858ecff583dd53800d997253) Signed-off-by: Rob Woolley <rob.woolley@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/knotty.py43
1 files changed, 24 insertions, 19 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index ea20ddc..09a4e0c 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -536,24 +536,29 @@ def main(server, eventHandler, params, tf = TerminalFilter):
if not params.observe_only:
_, error = server.runCommand(["stateForceShutdown"])
main.shutdown = 2
- summary = ""
- if taskfailures:
- summary += pluralise("\nSummary: %s task failed:",
- "\nSummary: %s tasks failed:", len(taskfailures))
- for failure in taskfailures:
- summary += "\n %s" % failure
- if warnings:
- summary += pluralise("\nSummary: There was %s WARNING message shown.",
- "\nSummary: There were %s WARNING messages shown.", warnings)
- if return_value and errors:
- summary += pluralise("\nSummary: There was %s ERROR message shown, returning a non-zero exit code.",
- "\nSummary: There were %s ERROR messages shown, returning a non-zero exit code.", errors)
- if summary:
- print(summary)
-
- if interrupted:
- print("Execution was interrupted, returning a non-zero exit code.")
- if return_value == 0:
- return_value = 1
+ try:
+ summary = ""
+ if taskfailures:
+ summary += pluralise("\nSummary: %s task failed:",
+ "\nSummary: %s tasks failed:", len(taskfailures))
+ for failure in taskfailures:
+ summary += "\n %s" % failure
+ if warnings:
+ summary += pluralise("\nSummary: There was %s WARNING message shown.",
+ "\nSummary: There were %s WARNING messages shown.", warnings)
+ if return_value and errors:
+ summary += pluralise("\nSummary: There was %s ERROR message shown, returning a non-zero exit code.",
+ "\nSummary: There were %s ERROR messages shown, returning a non-zero exit code.", errors)
+ if summary:
+ print(summary)
+
+ if interrupted:
+ print("Execution was interrupted, returning a non-zero exit code.")
+ if return_value == 0:
+ return_value = 1
+ except IOError as e:
+ import errno
+ if e.errno == errno.EPIPE:
+ pass
return return_value
OpenPOWER on IntegriCloud