[gnome-continuous-yocto/gnomeostree-3.28-rocko: 4101/8267] bitbake: event/ast: Add RecipeTaskPreProcess event before task finalisation



commit 631229df720dc88047b702452c7ad172421cc1e4
Author: Richard Purdie <richard purdie linuxfoundation org>
Date:   Thu Jan 12 13:25:36 2017 +0000

    bitbake: event/ast: Add RecipeTaskPreProcess event before task finalisation
    
    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.
    
    (Bitbake rev: 4dcd0e53f5ff4bf4f2d6cbdc51ff33a5f5f206af)
    
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 bitbake/lib/bb/event.py     |   11 +++++++++++
 bitbake/lib/bb/parse/ast.py |    1 +
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index e2ca33e..6d8493b 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -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 """
 
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 853dda8..8b5b366 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/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, list(tasklist)), d)
     bb.build.add_tasks(tasklist, d)
 
     bb.parse.siggen.finalise(fn, d, variant)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]