diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-09 17:30:17 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-09 22:43:46 +0100 |
commit | b8321c5658124c50009a3c4dbead2df49e662812 (patch) | |
tree | 9493804fd8095e9f3f45804bd678abf6097e4008 /bitbake/lib | |
parent | af93b8937e0eab940879646f579948d814faeb2b (diff) | |
download | ast2050-yocto-poky-b8321c5658124c50009a3c4dbead2df49e662812.zip ast2050-yocto-poky-b8321c5658124c50009a3c4dbead2df49e662812.tar.gz |
bitbake/event/ast: Add RecipePreFinalise event
One of the implications is we need to register the event handlers before
executing the anonymous python functions. I can't find any issue with making
that change in any existing metadata use cases.
(Bitbake rev: a981df3cc9bf410d24f39919959952bdc6c76d03)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/event.py | 10 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 15 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 1 |
3 files changed, 17 insertions, 9 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index a3288b6..7d47edb 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py @@ -206,13 +206,17 @@ def getName(e): class ConfigParsed(Event): """Configuration Parsing Complete""" -class RecipeParsed(Event): - """ Recipe Parsing Complete """ - +class RecipeEvent(Event): def __init__(self, fn): self.fn = fn Event.__init__(self) +class RecipePreFinalise(RecipeEvent): + """ Recipe Parsing Complete but not yet finialised""" + +class RecipeParsed(RecipeEvent): + """ Recipe Parsing Complete """ + class StampUpdate(Event): """Trigger for any adjustment of the stamp files to happen""" diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 547ea67..1180911 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py @@ -308,12 +308,6 @@ def handleInherit(statements, filename, lineno, m): def finalize(fn, d, variant = None): bb.data.expandKeys(d) - bb.data.update_data(d) - code = [] - for funcname in bb.data.getVar("__BBANONFUNCS", d) or []: - code.append("%s(d)" % funcname) - bb.utils.simple_exec("\n".join(code), {"d": d}) - bb.data.update_data(d) all_handlers = {} for var in bb.data.getVar('__BBHANDLERS', d) or []: @@ -321,6 +315,15 @@ def finalize(fn, d, variant = None): handler = bb.data.getVar(var, d) bb.event.register(var, handler) + bb.event.fire(bb.event.RecipePreFinalise(fn), d) + + bb.data.update_data(d) + code = [] + for funcname in bb.data.getVar("__BBANONFUNCS", d) or []: + code.append("%s(d)" % funcname) + bb.utils.simple_exec("\n".join(code), {"d": d}) + bb.data.update_data(d) + tasklist = bb.data.getVar('__BBTASKS', d) or [] bb.build.add_tasks(tasklist, d) diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index f330c08..997eb3f 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py @@ -228,6 +228,7 @@ def main(server, eventHandler): bb.event.StampUpdate, bb.event.ConfigParsed, bb.event.RecipeParsed, + bb.event.RecipePreFinalise, bb.runqueue.runQueueEvent, bb.runqueue.runQueueExitWait)): continue |