]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
event/ast: Add RecipeTaskPreProcess event before task finalisation
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 12 Jan 2017 13:25:36 +0000 (13:25 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Jan 2017 15:22:00 +0000 (15:22 +0000)
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@linuxfoundation.org>
lib/bb/event.py
lib/bb/parse/ast.py

index e2ca33ea630822bfbbbacfe50a81572acc6a5e0a..6d8493b175eed05a8cc0590dc000b0e235e8ff60 100644 (file)
@@ -361,6 +361,17 @@ class RecipeEvent(Event):
 class RecipePreFinalise(RecipeEvent):
     """ Recipe Parsing Complete but not yet finialised"""
 
+class RecipeTaskPreProcess(RecipeEvent):
+    """
+    Recipe Tasks about to be finalised
+    The list of tasks should be final at this point and handlers
+    are only able to change interdependencies
+    """
+    def __init__(self, fn, tasklist):
+        self.fn = fn
+        self.tasklist = tasklist
+        Event.__init__(self)
+
 class RecipeParsed(RecipeEvent):
     """ Recipe Parsing Complete """
 
index 853dda86b488b117ced6bed8f3fa530b7c49a8a7..8b5b36619d7fe34129865c7876135ddc88ce3bc1 100644 (file)
@@ -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, list(tasklist)), d)
     bb.build.add_tasks(tasklist, d)
 
     bb.parse.siggen.finalise(fn, d, variant)