bitbake/build.py: Add support for pre and postfuncs for tasks

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie 2010-08-04 11:30:39 +01:00
parent b83179c87e
commit 0f516fe9a0
1 changed files with 6 additions and 0 deletions

View File

@ -282,7 +282,13 @@ def exec_task(task, d):
data.update_data(localdata)
data.expandKeys(localdata)
event.fire(TaskStarted(task, localdata), localdata)
prefuncs = (data.getVarFlag(task, 'prefuncs', localdata) or "").split()
for func in prefuncs:
exec_func(func, localdata)
exec_func(task, localdata)
postfuncs = (data.getVarFlag(task, 'postfuncs', localdata) or "").split()
for func in postfuncs:
exec_func(func, localdata)
event.fire(TaskSucceeded(task, localdata), localdata)
except FuncFailed as message:
# Try to extract the optional logfile