summaryrefslogtreecommitdiffstats
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
parent7f30749fe026e9ceb75d73b89271145a45a60763 (diff)
downloadpoky-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>
-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 ea20ddc7e0..09a4e0cdcc 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):
536 if not params.observe_only: 536 if not params.observe_only:
537 _, error = server.runCommand(["stateForceShutdown"]) 537 _, error = server.runCommand(["stateForceShutdown"])
538 main.shutdown = 2 538 main.shutdown = 2
539 summary = "" 539 try:
540 if taskfailures: 540 summary = ""
541 summary += pluralise("\nSummary: %s task failed:", 541 if taskfailures:
542 "\nSummary: %s tasks failed:", len(taskfailures)) 542 summary += pluralise("\nSummary: %s task failed:",
543 for failure in taskfailures: 543 "\nSummary: %s tasks failed:", len(taskfailures))
544 summary += "\n %s" % failure 544 for failure in taskfailures:
545 if warnings: 545 summary += "\n %s" % failure
546 summary += pluralise("\nSummary: There was %s WARNING message shown.", 546 if warnings:
547 "\nSummary: There were %s WARNING messages shown.", warnings) 547 summary += pluralise("\nSummary: There was %s WARNING message shown.",
548 if return_value and errors: 548 "\nSummary: There were %s WARNING messages shown.", warnings)
549 summary += pluralise("\nSummary: There was %s ERROR message shown, returning a non-zero exit code.", 549 if return_value and errors:
550 "\nSummary: There were %s ERROR messages shown, returning a non-zero exit code.", errors) 550 summary += pluralise("\nSummary: There was %s ERROR message shown, returning a non-zero exit code.",
551 if summary: 551 "\nSummary: There were %s ERROR messages shown, returning a non-zero exit code.", errors)
552 print(summary) 552 if summary:
553 553 print(summary)
554 if interrupted: 554
555 print("Execution was interrupted, returning a non-zero exit code.") 555 if interrupted:
556 if return_value == 0: 556 print("Execution was interrupted, returning a non-zero exit code.")
557 return_value = 1 557 if return_value == 0:
558 return_value = 1
559 except IOError as e:
560 import errno
561 if e.errno == errno.EPIPE:
562 pass
558 563
559 return return_value 564 return return_value