summaryrefslogtreecommitdiffstats
path: root/lib/bb/build.py
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-04 11:30:39 +0100
committerChris Larson <chris_larson@mentor.com>2010-12-17 18:13:33 -0700
commitde2368ce38dbf6772383832f972d0d3ef4ac0cd2 (patch)
treeca31f293931c8773bb519eaa569cb5aae94f027b /lib/bb/build.py
parent23c6122437b5011d2213d717d8529cd1221b42b5 (diff)
downloadbitbake-de2368ce38dbf6772383832f972d0d3ef4ac0cd2.tar.gz
build: Add support for pre and postfuncs for tasks
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com> Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/build.py')
-rw-r--r--lib/bb/build.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index e4153269d..e91895302 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -278,10 +278,17 @@ def exec_task(fn, task, d):
except OSError:
pass
+ prefuncs = localdata.getVarFlag(task, 'prefuncs', expand=True)
+ postfuncs = localdata.getVarFlag(task, 'postfuncs', expand=True)
+
logfile = open(logfn, 'w')
event.fire(TaskStarted(task, localdata), localdata)
try:
+ for func in (prefuncs or '').split():
+ exec_func(func, localdata, logfile=logfile)
exec_func(task, localdata, logfile=logfile)
+ for func in (postfuncs or '').split():
+ exec_func(func, localdata, logfile=logfile)
except FuncFailed as exc:
event.fire(TaskFailed(exc.name, exc.logfile, localdata), localdata)
raise