summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-09 17:30:17 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-09 22:43:46 +0100
commitb8321c5658124c50009a3c4dbead2df49e662812 (patch)
tree9493804fd8095e9f3f45804bd678abf6097e4008 /bitbake
parentaf93b8937e0eab940879646f579948d814faeb2b (diff)
downloadpoky-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')
-rw-r--r--bitbake/lib/bb/event.py10
-rw-r--r--bitbake/lib/bb/parse/ast.py15
-rw-r--r--bitbake/lib/bb/ui/knotty.py1
3 files changed, 17 insertions, 9 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index a3288b619b..7d47edb9e7 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -206,13 +206,17 @@ def getName(e):
206class ConfigParsed(Event): 206class ConfigParsed(Event):
207 """Configuration Parsing Complete""" 207 """Configuration Parsing Complete"""
208 208
209class RecipeParsed(Event): 209class RecipeEvent(Event):
210 """ Recipe Parsing Complete """
211
212 def __init__(self, fn): 210 def __init__(self, fn):
213 self.fn = fn 211 self.fn = fn
214 Event.__init__(self) 212 Event.__init__(self)
215 213
214class RecipePreFinalise(RecipeEvent):
215 """ Recipe Parsing Complete but not yet finialised"""
216
217class RecipeParsed(RecipeEvent):
218 """ Recipe Parsing Complete """
219
216class StampUpdate(Event): 220class StampUpdate(Event):
217 """Trigger for any adjustment of the stamp files to happen""" 221 """Trigger for any adjustment of the stamp files to happen"""
218 222
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 547ea679b5..1180911a7d 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):
308 308
309def finalize(fn, d, variant = None): 309def finalize(fn, d, variant = None):
310 bb.data.expandKeys(d) 310 bb.data.expandKeys(d)
311 bb.data.update_data(d)
312 code = []
313 for funcname in bb.data.getVar("__BBANONFUNCS", d) or []:
314 code.append("%s(d)" % funcname)
315 bb.utils.simple_exec("\n".join(code), {"d": d})
316 bb.data.update_data(d)
317 311
318 all_handlers = {} 312 all_handlers = {}
319 for var in bb.data.getVar('__BBHANDLERS', d) or []: 313 for var in bb.data.getVar('__BBHANDLERS', d) or []:
@@ -321,6 +315,15 @@ def finalize(fn, d, variant = None):
321 handler = bb.data.getVar(var, d) 315 handler = bb.data.getVar(var, d)
322 bb.event.register(var, handler) 316 bb.event.register(var, handler)
323 317
318 bb.event.fire(bb.event.RecipePreFinalise(fn), d)
319
320 bb.data.update_data(d)
321 code = []
322 for funcname in bb.data.getVar("__BBANONFUNCS", d) or []:
323 code.append("%s(d)" % funcname)
324 bb.utils.simple_exec("\n".join(code), {"d": d})
325 bb.data.update_data(d)
326
324 tasklist = bb.data.getVar('__BBTASKS', d) or [] 327 tasklist = bb.data.getVar('__BBTASKS', d) or []
325 bb.build.add_tasks(tasklist, d) 328 bb.build.add_tasks(tasklist, d)
326 329
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index f330c084df..997eb3fe89 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -228,6 +228,7 @@ def main(server, eventHandler):
228 bb.event.StampUpdate, 228 bb.event.StampUpdate,
229 bb.event.ConfigParsed, 229 bb.event.ConfigParsed,
230 bb.event.RecipeParsed, 230 bb.event.RecipeParsed,
231 bb.event.RecipePreFinalise,
231 bb.runqueue.runQueueEvent, 232 bb.runqueue.runQueueEvent,
232 bb.runqueue.runQueueExitWait)): 233 bb.runqueue.runQueueExitWait)):
233 continue 234 continue