summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/ast.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 10:45:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 17:08:07 +0000
commitba82035412d5dec2ce6f8a459ee52da48b1afe32 (patch)
tree2669fa096510cb8bfb691843c47ce96222538219 /bitbake/lib/bb/parse/ast.py
parent8a82a3835cb5b38812da720914d5f47a7cd443e8 (diff)
downloadpoky-ba82035412d5dec2ce6f8a459ee52da48b1afe32.tar.gz
bitbake: build/ast: Create strong task add/del API in bb.build
Currently its near impossible to control task addition/deletion from metadata context. This adds stong add/deltask API to bb.build which is traditionally where it resided. The rather broken remove_tasks function was removed, it didn't appear to do anything useful or have any users. This allows us to clean up hacks currently in use in metadata and use standard API for it instead. (Bitbake rev: bf7138dd38fc1f8efca80891198e3422fef64093) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse/ast.py')
-rw-r--r--bitbake/lib/bb/parse/ast.py33
1 files changed, 2 insertions, 31 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 2036cd43fe..a2020532ea 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -235,29 +235,7 @@ class AddTaskNode(AstNode):
235 self.after = after 235 self.after = after
236 236
237 def eval(self, data): 237 def eval(self, data):
238 var = self.func 238 bb.build.addtask(self.func, self.before, self.after, data)
239 if self.func[:3] != "do_":
240 var = "do_" + self.func
241
242 data.setVarFlag(var, "task", 1)
243 bbtasks = data.getVar('__BBTASKS') or []
244 if not var in bbtasks:
245 bbtasks.append(var)
246 data.setVar('__BBTASKS', bbtasks)
247
248 existing = data.getVarFlag(var, "deps") or []
249 if self.after is not None:
250 # set up deps for function
251 for entry in self.after.split():
252 if entry not in existing:
253 existing.append(entry)
254 data.setVarFlag(var, "deps", existing)
255 if self.before is not None:
256 # set up things that depend on this func
257 for entry in self.before.split():
258 existing = data.getVarFlag(entry, "deps") or []
259 if var not in existing:
260 data.setVarFlag(entry, "deps", [var] + existing)
261 239
262class DelTaskNode(AstNode): 240class DelTaskNode(AstNode):
263 def __init__(self, filename, lineno, func): 241 def __init__(self, filename, lineno, func):
@@ -265,14 +243,7 @@ class DelTaskNode(AstNode):
265 self.func = func 243 self.func = func
266 244
267 def eval(self, data): 245 def eval(self, data):
268 var = self.func 246 bb.build.deltask(self.func, data)
269 if self.func[:3] != "do_":
270 var = "do_" + self.func
271
272 bbtasks = data.getVar('__BBDELTASKS') or []
273 if not var in bbtasks:
274 bbtasks.append(var)
275 data.setVar('__BBDELTASKS', bbtasks)
276 247
277class BBHandlerNode(AstNode): 248class BBHandlerNode(AstNode):
278 def __init__(self, filename, lineno, fns): 249 def __init__(self, filename, lineno, fns):