[bitbake-devel] [PATCH v2 1/3] event/ast: Add RecipeTaskPreProcess event before task finalisation

Patrick Ohly patrick.ohly at intel.com
Fri Jan 13 14:51:19 UTC 2017


From: Richard Purdie <richard.purdie at linuxfoundation.org>

There are various pieces of code which need to run after the tasks are
finalised but before bitbake locks in on the task dependencies. This
adds such an event so dependency changes in anonymous python can
be accounted for and acted upon by these specific event handlers.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/event.py     | 7 +++++++
 lib/bb/parse/ast.py | 1 +
 2 files changed, 8 insertions(+)

diff --git a/lib/bb/event.py b/lib/bb/event.py
index e2ca33e..946d518 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -361,6 +361,13 @@ class RecipeEvent(Event):
 class RecipePreFinalise(RecipeEvent):
     """ Recipe Parsing Complete but not yet finialised"""
 
+class RecipeTaskPreProcess(RecipeEvent):
+    """Recipe Tasks about to be finalised"""
+    def __init__(self, fn, tasklist):
+        self.fn = fn
+        self.tasklist = tasklist
+        Event.__init__(self)
+
 class RecipeParsed(RecipeEvent):
     """ Recipe Parsing Complete """
 
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index 853dda8..f3a8a50 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -358,6 +358,7 @@ def finalize(fn, d, variant = None):
     bb.data.update_data(d)
 
     tasklist = d.getVar('__BBTASKS', False) or []
+    bb.event.fire(bb.event.RecipeTaskPreProcess(fn, tasklist), d)
     bb.build.add_tasks(tasklist, d)
 
     bb.parse.siggen.finalise(fn, d, variant)
-- 
git-series 0.9.1



More information about the bitbake-devel mailing list