]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
knotty: Handle process indicators more gracefully
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 7 Jul 2016 13:26:34 +0000 (14:26 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 8 Jul 2016 08:57:06 +0000 (09:57 +0100)
Mistakes can happen with the generation of the progress events, change
knotty to be more tolerant of this rather than crashing, reporting to the
user when something unexpected happens. I haven't debugged why multiple
finish events appear to be triggered.

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

index dbcb9c417b0cbbb715e8faffdc41f1ee44a98eb2..e8e169fe679b032f68812e24830f5f5d7ae26cb5 100644 (file)
@@ -496,13 +496,16 @@ def main(server, eventHandler, params, tf = TerminalFilter):
                 parseprogress = new_progress("Parsing recipes", event.total).start()
                 continue
             if isinstance(event, bb.event.ParseProgress):
-                parseprogress.update(event.current)
+                if parseprogress:
+                    parseprogress.update(event.current)
+                else:
+                    bb.warn("Got ParseProgress event for parsing that never started?")
                 continue
             if isinstance(event, bb.event.ParseCompleted):
                 if not parseprogress:
                     continue
-
                 parseprogress.finish()
+                pasreprogress = None
                 if not params.options.quiet:
                     print(("Parsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
                         % ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors)))
@@ -606,10 +609,15 @@ def main(server, eventHandler, params, tf = TerminalFilter):
                 parseprogress.start(False)
                 continue
             if isinstance(event, bb.event.ProcessProgress):
-                parseprogress.update(event.progress)
+                if parseprogress:
+                    parseprogress.update(event.progress)
+                else:
+                    bb.warn("Got ProcessProgress event for someting that never started?")
                 continue
             if isinstance(event, bb.event.ProcessFinished):
-                parseprogress.finish()
+                if parseprogress:
+                    parseprogress.finish()
+                parseprogress = None
                 continue
 
             # ignore