[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1204/8267] bitbake: knotty: add code to support showing progress for sstate object querying
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 1204/8267] bitbake: knotty: add code to support showing progress for sstate object querying
- Date: Sat, 16 Dec 2017 21:30:00 +0000 (UTC)
commit 8d56d596bb2e48332e8f8c6aed78445f7ffb44bf
Author: Paul Eggleton <paul eggleton linux intel com>
Date: Thu Jun 23 22:59:08 2016 +1200
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>
bitbake/lib/bb/event.py | 27 +++++++++++++++++++++++++++
bitbake/lib/bb/ui/knotty.py | 15 +++++++++++++--
2 files changed, 40 insertions(+), 2 deletions(-)
---
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 9b4a4f9..a5f026e 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -647,6 +647,33 @@ class MetadataEvent(Event):
self.type = eventtype
self._localdata = eventdata
+class ProcessStarted(Event):
+ """
+ Generic process started event (usually part of the initial startup)
+ where further progress events will be delivered
+ """
+ def __init__(self, processname, total):
+ Event.__init__(self)
+ self.processname = processname
+ self.total = total
+
+class ProcessProgress(Event):
+ """
+ Generic process progress event (usually part of the initial startup)
+ """
+ def __init__(self, processname, progress):
+ Event.__init__(self)
+ self.processname = processname
+ self.progress = progress
+
+class ProcessFinished(Event):
+ """
+ Generic process finished event (usually part of the initial startup)
+ """
+ def __init__(self, processname):
+ Event.__init__(self)
+ self.processname = processname
+
class SanityCheck(Event):
"""
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 2513501..6fdaafe 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -90,7 +90,7 @@ class NonInteractiveProgress(object):
self.msg = msg
self.maxval = maxval
- def start(self):
+ def start(self, update=True):
self.fobj.write("%s..." % self.msg)
self.fobj.flush()
return self
@@ -304,7 +304,7 @@ _evt_list = [ "bb.runqueue.runQueueExitWait", "bb.event.LogExecTTY", "logging.Lo
"bb.event.MultipleProviders", "bb.event.NoProvider", "bb.runqueue.sceneQueueTaskStarted",
"bb.runqueue.runQueueTaskStarted", "bb.runqueue.runQueueTaskFailed",
"bb.runqueue.sceneQueueTaskFailed",
"bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded",
"bb.build.TaskFailedSilent",
- "bb.build.TaskProgress"]
+ "bb.build.TaskProgress", "bb.event.ProcessStarted", "bb.event.ProcessProgress",
"bb.event.ProcessFinished"]
def main(server, eventHandler, params, tf = TerminalFilter):
@@ -579,6 +579,17 @@ def main(server, eventHandler, params, tf = TerminalFilter):
if isinstance(event, bb.event.DepTreeGenerated):
continue
+ if isinstance(event, bb.event.ProcessStarted):
+ parseprogress = new_progress(event.processname, event.total)
+ parseprogress.start(False)
+ continue
+ if isinstance(event, bb.event.ProcessProgress):
+ parseprogress.update(event.progress)
+ continue
+ if isinstance(event, bb.event.ProcessFinished):
+ parseprogress.finish()
+ continue
+
# ignore
if isinstance(event, (bb.event.BuildBase,
bb.event.MetadataEvent,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]