summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/ast.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/ast.py')
-rw-r--r--bitbake/lib/bb/parse/ast.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index d4b8b09543..2036cd43fe 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -259,6 +259,21 @@ class AddTaskNode(AstNode):
259 if var not in existing: 259 if var not in existing:
260 data.setVarFlag(entry, "deps", [var] + existing) 260 data.setVarFlag(entry, "deps", [var] + existing)
261 261
262class DelTaskNode(AstNode):
263 def __init__(self, filename, lineno, func):
264 AstNode.__init__(self, filename, lineno)
265 self.func = func
266
267 def eval(self, data):
268 var = self.func
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
262class BBHandlerNode(AstNode): 277class BBHandlerNode(AstNode):
263 def __init__(self, filename, lineno, fns): 278 def __init__(self, filename, lineno, fns):
264 AstNode.__init__(self, filename, lineno) 279 AstNode.__init__(self, filename, lineno)
@@ -309,6 +324,13 @@ def handleAddTask(statements, filename, lineno, m):
309 324
310 statements.append(AddTaskNode(filename, lineno, func, before, after)) 325 statements.append(AddTaskNode(filename, lineno, func, before, after))
311 326
327def handleDelTask(statements, filename, lineno, m):
328 func = m.group("func")
329 if func is None:
330 return
331
332 statements.append(DelTaskNode(filename, lineno, func))
333
312def handleBBHandlers(statements, filename, lineno, m): 334def handleBBHandlers(statements, filename, lineno, m):
313 statements.append(BBHandlerNode(filename, lineno, m.group(1))) 335 statements.append(BBHandlerNode(filename, lineno, m.group(1)))
314 336
@@ -333,7 +355,8 @@ def finalize(fn, d, variant = None):
333 bb.data.update_data(d) 355 bb.data.update_data(d)
334 356
335 tasklist = d.getVar('__BBTASKS') or [] 357 tasklist = d.getVar('__BBTASKS') or []
336 bb.build.add_tasks(tasklist, d) 358 deltasklist = d.getVar('__BBDELTASKS') or []
359 bb.build.add_tasks(tasklist, deltasklist, d)
337 360
338 bb.parse.siggen.finalise(fn, d, variant) 361 bb.parse.siggen.finalise(fn, d, variant)
339 362