summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-06-23 22:59:08 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-08 09:57:26 +0100
commit8d56d596bb2e48332e8f8c6aed78445f7ffb44bf (patch)
tree71fca3c860622183e43f7633db72a367113aff94
parent0e3281f68b511ab7bf9d6b1c1f905ec794d3032a (diff)
downloadpoky-8d56d596bb2e48332e8f8c6aed78445f7ffb44bf.tar.gz
bitbake: knotty: add code to support showing progress for sstate object querying
Add support code on the BitBake side to allow sstate.bbclass in OpenEmbedded to report progress when it is checking for availability of artifacts from shared state mirrors. Part of the implementation for [YOCTO #5853]. (Bitbake rev: 070ae856da0715dbaf4c560c837ea796ffc29f00) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/event.py27
-rw-r--r--bitbake/lib/bb/ui/knotty.py15
2 files changed, 40 insertions, 2 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 9b4a4f97b5..a5f026e151 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -647,6 +647,33 @@ class MetadataEvent(Event):
647 self.type = eventtype 647 self.type = eventtype
648 self._localdata = eventdata 648 self._localdata = eventdata
649 649
650class ProcessStarted(Event):
651 """
652 Generic process started event (usually part of the initial startup)
653 where further progress events will be delivered
654 """
655 def __init__(self, processname, total):
656 Event.__init__(self)
657 self.processname = processname
658 self.total = total
659
660class ProcessProgress(Event):
661 """
662 Generic process progress event (usually part of the initial startup)
663 """
664 def __init__(self, processname, progress):
665 Event.__init__(self)
666 self.processname = processname
667 self.progress = progress
668
669class ProcessFinished(Event):
670 """
671 Generic process finished event (usually part of the initial startup)
672 """
673 def __init__(self, processname):
674 Event.__init__(self)
675 self.processname = processname
676
650class SanityCheck(Event): 677class SanityCheck(Event):
651 """ 678 """
652 Event to run sanity checks, either raise errors or generate events as return status. 679 Event to run sanity checks, either raise errors or generate events as return status.
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 2513501500..6fdaafedb7 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -90,7 +90,7 @@ class NonInteractiveProgress(object):
90 self.msg = msg 90 self.msg = msg
91 self.maxval = maxval 91 self.maxval = maxval
92 92
93 def start(self): 93 def start(self, update=True):
94 self.fobj.write("%s..." % self.msg) 94 self.fobj.write("%s..." % self.msg)
95 self.fobj.flush() 95 self.fobj.flush()
96 return self 96 return self
@@ -304,7 +304,7 @@ _evt_list = [ "bb.runqueue.runQueueExitWait", "bb.event.LogExecTTY", "logging.Lo
304 "bb.event.MultipleProviders", "bb.event.NoProvider", "bb.runqueue.sceneQueueTaskStarted", 304 "bb.event.MultipleProviders", "bb.event.NoProvider", "bb.runqueue.sceneQueueTaskStarted",
305 "bb.runqueue.runQueueTaskStarted", "bb.runqueue.runQueueTaskFailed", "bb.runqueue.sceneQueueTaskFailed", 305 "bb.runqueue.runQueueTaskStarted", "bb.runqueue.runQueueTaskFailed", "bb.runqueue.sceneQueueTaskFailed",
306 "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent", 306 "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent",
307 "bb.build.TaskProgress"] 307 "bb.build.TaskProgress", "bb.event.ProcessStarted", "bb.event.ProcessProgress", "bb.event.ProcessFinished"]
308 308
309def main(server, eventHandler, params, tf = TerminalFilter): 309def main(server, eventHandler, params, tf = TerminalFilter):
310 310
@@ -579,6 +579,17 @@ def main(server, eventHandler, params, tf = TerminalFilter):
579 if isinstance(event, bb.event.DepTreeGenerated): 579 if isinstance(event, bb.event.DepTreeGenerated):
580 continue 580 continue
581 581
582 if isinstance(event, bb.event.ProcessStarted):
583 parseprogress = new_progress(event.processname, event.total)
584 parseprogress.start(False)
585 continue
586 if isinstance(event, bb.event.ProcessProgress):
587 parseprogress.update(event.progress)
588 continue
589 if isinstance(event, bb.event.ProcessFinished):
590 parseprogress.finish()
591 continue
592
582 # ignore 593 # ignore
583 if isinstance(event, (bb.event.BuildBase, 594 if isinstance(event, (bb.event.BuildBase,
584 bb.event.MetadataEvent, 595 bb.event.MetadataEvent,