diff options
-rw-r--r-- | bitbake/lib/bb/build.py | 6 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 25 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 6 |
3 files changed, 35 insertions, 2 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 92c45a38c9..6b395264b6 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -622,7 +622,7 @@ def stampfile(taskname, d, file_name = None): | |||
622 | """ | 622 | """ |
623 | return stamp_internal(taskname, d, file_name) | 623 | return stamp_internal(taskname, d, file_name) |
624 | 624 | ||
625 | def add_tasks(tasklist, d): | 625 | def add_tasks(tasklist, deltasklist, d): |
626 | task_deps = d.getVar('_task_deps') | 626 | task_deps = d.getVar('_task_deps') |
627 | if not task_deps: | 627 | if not task_deps: |
628 | task_deps = {} | 628 | task_deps = {} |
@@ -633,6 +633,10 @@ def add_tasks(tasklist, d): | |||
633 | 633 | ||
634 | for task in tasklist: | 634 | for task in tasklist: |
635 | task = d.expand(task) | 635 | task = d.expand(task) |
636 | |||
637 | if task in deltasklist: | ||
638 | continue | ||
639 | |||
636 | d.setVarFlag(task, 'task', 1) | 640 | d.setVarFlag(task, 'task', 1) |
637 | 641 | ||
638 | if not task in task_deps['tasks']: | 642 | if not task in task_deps['tasks']: |
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 | ||
262 | class 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 | |||
262 | class BBHandlerNode(AstNode): | 277 | class 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 | ||
327 | def 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 | |||
312 | def handleBBHandlers(statements, filename, lineno, m): | 334 | def 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 | ||
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 7cba649595..408890e48a 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
@@ -42,6 +42,7 @@ __func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)* | |||
42 | __inherit_regexp__ = re.compile( r"inherit\s+(.+)" ) | 42 | __inherit_regexp__ = re.compile( r"inherit\s+(.+)" ) |
43 | __export_func_regexp__ = re.compile( r"EXPORT_FUNCTIONS\s+(.+)" ) | 43 | __export_func_regexp__ = re.compile( r"EXPORT_FUNCTIONS\s+(.+)" ) |
44 | __addtask_regexp__ = re.compile("addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") | 44 | __addtask_regexp__ = re.compile("addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") |
45 | __deltask_regexp__ = re.compile("deltask\s+(?P<func>\w+)") | ||
45 | __addhandler_regexp__ = re.compile( r"addhandler\s+(.+)" ) | 46 | __addhandler_regexp__ = re.compile( r"addhandler\s+(.+)" ) |
46 | __def_regexp__ = re.compile( r"def\s+(\w+).*:" ) | 47 | __def_regexp__ = re.compile( r"def\s+(\w+).*:" ) |
47 | __python_func_regexp__ = re.compile( r"(\s+.*)|(^$)" ) | 48 | __python_func_regexp__ = re.compile( r"(\s+.*)|(^$)" ) |
@@ -243,6 +244,11 @@ def feeder(lineno, s, fn, root, statements): | |||
243 | ast.handleAddTask(statements, fn, lineno, m) | 244 | ast.handleAddTask(statements, fn, lineno, m) |
244 | return | 245 | return |
245 | 246 | ||
247 | m = __deltask_regexp__.match(s) | ||
248 | if m: | ||
249 | ast.handleDelTask(statements, fn, lineno, m) | ||
250 | return | ||
251 | |||
246 | m = __addhandler_regexp__.match(s) | 252 | m = __addhandler_regexp__.match(s) |
247 | if m: | 253 | if m: |
248 | ast.handleBBHandlers(statements, fn, lineno, m) | 254 | ast.handleBBHandlers(statements, fn, lineno, m) |