All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] knotty: Handle process indicators more gracefully
@ 2016-07-07 13:26 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2016-07-07 13:26 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Eggleton, Paul

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>

diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index dbcb9c4..e8e169f 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -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




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-07 13:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-07 13:26 [PATCH] knotty: Handle process indicators more gracefully Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.