diff options
Diffstat (limited to 'bitbake/lib/bb/ui/knotty.py')
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 205a8d8f39..e1d42f7871 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -64,6 +64,12 @@ def new_progress(msg, maxval): | |||
64 | else: | 64 | else: |
65 | return NonInteractiveProgress(msg, maxval) | 65 | return NonInteractiveProgress(msg, maxval) |
66 | 66 | ||
67 | def pluralise(singular, plural, qty): | ||
68 | if(qty == 1): | ||
69 | return singular % qty | ||
70 | else: | ||
71 | return plural % qty | ||
72 | |||
67 | def main(server, eventHandler): | 73 | def main(server, eventHandler): |
68 | 74 | ||
69 | # Get values of variables which control our output | 75 | # Get values of variables which control our output |
@@ -107,6 +113,7 @@ def main(server, eventHandler): | |||
107 | return_value = 0 | 113 | return_value = 0 |
108 | errors = 0 | 114 | errors = 0 |
109 | warnings = 0 | 115 | warnings = 0 |
116 | taskfailures = [] | ||
110 | while True: | 117 | while True: |
111 | try: | 118 | try: |
112 | event = eventHandler.waitEvent(0.25) | 119 | event = eventHandler.waitEvent(0.25) |
@@ -240,6 +247,7 @@ def main(server, eventHandler): | |||
240 | continue | 247 | continue |
241 | 248 | ||
242 | if isinstance(event, bb.runqueue.runQueueTaskFailed): | 249 | if isinstance(event, bb.runqueue.runQueueTaskFailed): |
250 | taskfailures.append(event.taskstring) | ||
243 | logger.error("Task %s (%s) failed with exit code '%s'", | 251 | logger.error("Task %s (%s) failed with exit code '%s'", |
244 | event.taskid, event.taskstring, event.exitcode) | 252 | event.taskid, event.taskstring, event.exitcode) |
245 | continue | 253 | continue |
@@ -272,8 +280,20 @@ def main(server, eventHandler): | |||
272 | server.runCommand(["stateShutdown"]) | 280 | server.runCommand(["stateShutdown"]) |
273 | shutdown = shutdown + 1 | 281 | shutdown = shutdown + 1 |
274 | pass | 282 | pass |
283 | |||
284 | summary = "" | ||
285 | if taskfailures: | ||
286 | summary += pluralise("\nSummary: %s task failed:", | ||
287 | "\nSummary: %s tasks failed:", len(taskfailures)) | ||
288 | for failure in taskfailures: | ||
289 | summary += "\n %s" % failure | ||
275 | if warnings: | 290 | if warnings: |
276 | print("Summary: There were %s WARNING messages shown.\n" % warnings) | 291 | summary += pluralise("\nSummary: There was %s WARNING message shown.", |
292 | "\nSummary: There were %s WARNING messages shown.", warnings) | ||
277 | if return_value: | 293 | if return_value: |
278 | print("Summary: There were %s ERROR messages shown, returning a non-zero exit code.\n" % errors) | 294 | summary += pluralise("\nSummary: There was %s ERROR message shown, returning a non-zero exit code.", |
295 | "\nSummary: There were %s ERROR messages shown, returning a non-zero exit code.", errors) | ||
296 | if summary: | ||
297 | print(summary) | ||
298 | |||
279 | return return_value | 299 | return return_value |