Patchwork [bitbake-devel,1/1] bitbake/ui/knotty: fix incorrect exit code

login
register
mail settings
Submitter Paul Eggleton
Date Feb. 22, 2012, 9:24 p.m.
Message ID <a782708cb226bfcd8925833a94ba0a79e7301ad4.1329945681.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/21589/
State New
Headers show

Comments

Paul Eggleton - Feb. 22, 2012, 9:24 p.m.
The recent Ctrl+C patch was not fully tested; the variable it was
relying upon is set to non-zero under other circumstances and thus
bitbake was reporting that it was interrupted and returning a non-zero
exit code when it was not. Track this status in a separate variable
in order to fix the issue.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/ui/knotty.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Patch

diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 9881d82..158a132 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -110,6 +110,7 @@  def main(server, eventHandler):
     parseprogress = None
     cacheprogress = None
     shutdown = 0
+    interrupted = False
     return_value = 0
     errors = 0
     warnings = 0
@@ -276,6 +277,7 @@  def main(server, eventHandler):
                 print("\nSecond Keyboard Interrupt, stopping...\n")
                 server.runCommand(["stateStop"])
             if shutdown == 0:
+                interrupted = True
                 print("\nKeyboard Interrupt, closing down...\n")
                 server.runCommand(["stateShutdown"])
             shutdown = shutdown + 1
@@ -296,7 +298,7 @@  def main(server, eventHandler):
     if summary:
         print(summary)
 
-    if shutdown:
+    if interrupted:
         print("Execution was interrupted, returning a non-zero exit code.")
         if return_value == 0:
             return_value = 1