aboutsummaryrefslogtreecommitdiffstats
path: root/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 11:23:34 +0000
commitbf7138dd38fc1f8efca80891198e3422fef64093 (patch)
treedf8bf028127c3ea2770a2e9962057bd7c54cf5ac /lib/bb/parse/ast.py
parentacecbde6fb70ff3c96deab3cdf819d8442e87ed4 (diff)
downloadbitbake-bf7138dd38fc1f8efca80891198e3422fef64093.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/parse/ast.py')
-rw-r--r--lib/bb/parse/ast.py33
1 files changed, 2 insertions, 31 deletions
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index 2036cd43f..a2020532e 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -235,29 +235,7 @@ class AddTaskNode(AstNode):
self.after = after
def eval(self, data):
- var = self.func
- if self.func[:3] != "do_":
- var = "do_" + self.func
-
- data.setVarFlag(var, "task", 1)
- bbtasks = data.getVar('__BBTASKS') or []
- if not var in bbtasks:
- bbtasks.append(var)
- data.setVar('__BBTASKS', bbtasks)
-
- existing = data.getVarFlag(var, "deps") or []
- if self.after is not None:
- # set up deps for function
- for entry in self.after.split():
- if entry not in existing:
- existing.append(entry)
- data.setVarFlag(var, "deps", existing)
- if self.before is not None:
- # set up things that depend on this func
- for entry in self.before.split():
- existing = data.getVarFlag(entry, "deps") or []
- if var not in existing:
- data.setVarFlag(entry, "deps", [var] + existing)
+ bb.build.addtask(self.func, self.before, self.after, data)
class DelTaskNode(AstNode):
def __init__(self, filename, lineno, func):
@@ -265,14 +243,7 @@ class DelTaskNode(AstNode):
self.func = func
def eval(self, data):
- var = self.func
- if self.func[:3] != "do_":
- var = "do_" + self.func
-
- bbtasks = data.getVar('__BBDELTASKS') or []
- if not var in bbtasks:
- bbtasks.append(var)
- data.setVar('__BBDELTASKS', bbtasks)
+ bb.build.deltask(self.func, data)
class BBHandlerNode(AstNode):
def __init__(self, filename, lineno, fns):