]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
knotty: Cleanup error/interruption handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 13 Sep 2013 16:34:06 +0000 (17:34 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 13 Sep 2013 16:45:37 +0000 (17:45 +0100)
Only display a CommandFailed ERROR: message if there is an error to display.

Only display an errors summary if we actually displayed errors.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/ui/knotty.py

index f706b9759d0e1d334f6099d3add3ef061b76dc8a..35590a2a7947096636f6df92d814d190952920f0 100644 (file)
@@ -405,8 +405,9 @@ def main(server, eventHandler, params, tf = TerminalFilter):
 
             if isinstance(event, bb.command.CommandFailed):
                 return_value = event.exitcode
-                errors = errors + 1
-                logger.error("Command execution failed: %s", event.error)
+                if event.error:
+                    errors = errors + 1
+                    logger.error("Command execution failed: %s", event.error)
                 main.shutdown = 2
                 continue
             if isinstance(event, bb.command.CommandExit):
@@ -520,7 +521,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
     if warnings:
         summary += pluralise("\nSummary: There was %s WARNING message shown.",
                              "\nSummary: There were %s WARNING messages shown.", warnings)
-    if return_value:
+    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: