summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/parse/ast.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 6690dc51c2..9d20c323fe 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -343,30 +343,31 @@ def runAnonFuncs(d):
343 343
344def finalize(fn, d, variant = None): 344def finalize(fn, d, variant = None):
345 saved_handlers = bb.event.get_handlers().copy() 345 saved_handlers = bb.event.get_handlers().copy()
346 try:
347 for var in d.getVar('__BBHANDLERS', False) or []:
348 # try to add the handler
349 handlerfn = d.getVarFlag(var, "filename", False)
350 if not handlerfn:
351 bb.fatal("Undefined event handler function '%s'" % var)
352 handlerln = int(d.getVarFlag(var, "lineno", False))
353 bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln)
346 354
347 for var in d.getVar('__BBHANDLERS', False) or []: 355 bb.event.fire(bb.event.RecipePreFinalise(fn), d)
348 # try to add the handler
349 handlerfn = d.getVarFlag(var, "filename", False)
350 if not handlerfn:
351 bb.fatal("Undefined event handler function '%s'" % var)
352 handlerln = int(d.getVarFlag(var, "lineno", False))
353 bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln)
354
355 bb.event.fire(bb.event.RecipePreFinalise(fn), d)
356 356
357 bb.data.expandKeys(d) 357 bb.data.expandKeys(d)
358 runAnonFuncs(d) 358 runAnonFuncs(d)
359 359
360 tasklist = d.getVar('__BBTASKS', False) or [] 360 tasklist = d.getVar('__BBTASKS', False) or []
361 bb.event.fire(bb.event.RecipeTaskPreProcess(fn, list(tasklist)), d) 361 bb.event.fire(bb.event.RecipeTaskPreProcess(fn, list(tasklist)), d)
362 bb.build.add_tasks(tasklist, d) 362 bb.build.add_tasks(tasklist, d)
363 363
364 bb.parse.siggen.finalise(fn, d, variant) 364 bb.parse.siggen.finalise(fn, d, variant)
365 365
366 d.setVar('BBINCLUDED', bb.parse.get_file_depends(d)) 366 d.setVar('BBINCLUDED', bb.parse.get_file_depends(d))
367 367
368 bb.event.fire(bb.event.RecipeParsed(fn), d) 368 bb.event.fire(bb.event.RecipeParsed(fn), d)
369 bb.event.set_handlers(saved_handlers) 369 finally:
370 bb.event.set_handlers(saved_handlers)
370 371
371def _create_variants(datastores, names, function, onlyfinalise): 372def _create_variants(datastores, names, function, onlyfinalise):
372 def create_variant(name, orig_d, arg = None): 373 def create_variant(name, orig_d, arg = None):