Patchwork [bitbake-devel,02/13] bitbake: runqueue: Add runQueueTaskSkipped event

login
register
mail settings
Submitter Alexandru DAMIAN
Date Sept. 9, 2013, 4:40 p.m.
Message ID <f563c67ca531573081338b958982e719f370cee6.1378743829.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/57707/
State New
Headers show

Comments

Alexandru DAMIAN - Sept. 9, 2013, 4:40 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

Adding a runQueueTaskSkipped to notify all listeners
about the tasks that are not run either because they
are set-scened or they don't need an update (timestamps
are ok)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 bitbake/lib/bb/runqueue.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Patch

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index a868332..f084407 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -217,6 +217,12 @@  class RunQueueData:
             ret.extend([nam])
         return ret
 
+    def get_task_name(self, task):
+        return self.runq_task[task]
+
+    def get_task_package(self, task):
+        return self.taskData.fn_index[self.runq_fnid[task]]
+
     def get_user_idstring(self, task, task_name_suffix = ""):
         fn = self.taskData.fn_index[self.runq_fnid[task]]
         taskname = self.runq_task[task] + task_name_suffix
@@ -1328,6 +1334,7 @@  class RunQueueExecuteTasks(RunQueueExecute):
     def task_skip(self, task):
         self.runq_running[task] = 1
         self.runq_buildable[task] = 1
+        bb.event.fire(runQueueTaskSkipped(task, self.stats, self.rq), self.cfgData)
         self.task_completeoutright(task)
         self.stats.taskCompleted()
         self.stats.taskSkipped()
@@ -1828,6 +1835,15 @@  class runQueueTaskCompleted(runQueueEvent):
     Event notifing a task completed
     """
 
+class runQueueTaskSkipped(runQueueEvent):
+    """
+    Event notifing a task was skipped
+    """
+    def __init__(self, task, stats, rq):
+        runQueueEvent.__init__(self, task, stats, rq)
+        self._package = rq.rqdata.get_task_package(task)
+        self._task = rq.rqdata.get_task_name(task)
+
 class runQueuePipe():
     """
     Abstraction for a pipe between a worker thread and the server