diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-01 11:09:09 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-21 16:57:43 +0100 |
commit | acce65abb98529be15748892480d4c24396556f2 (patch) | |
tree | 2536b5509c6004dc6fce2bc9c100af23598738ca /bitbake/lib/bb/parse/ast.py | |
parent | 0aff94023f931a84d21069d92522e0f5338f09a4 (diff) | |
download | poky-acce65abb98529be15748892480d4c24396556f2.tar.gz |
bitbake: build: Allow deltask to take multiple tasknames
deltask currently supports only one task to delete but it would be useful
if it could support a variable which gets expanded to allow flexibility
in the metadata.
This is simple to support in bitbake and is how other directives such
as inherit operate so adjust the parser/code to handle that. It means
that syntax like:
EXTRA_NOPACKAGE_DELTASKS = ""
deltask ${EXTRA_NOPACKAGE_DELTASKS}
is now allowed.
(Bitbake rev: 883d926120833c85a16dcf60425dd7af7699046a)
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.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 785aa974eb..0714296af2 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -244,12 +244,14 @@ class AddTaskNode(AstNode): | |||
244 | bb.build.addtask(self.func, self.before, self.after, data) | 244 | bb.build.addtask(self.func, self.before, self.after, data) |
245 | 245 | ||
246 | class DelTaskNode(AstNode): | 246 | class DelTaskNode(AstNode): |
247 | def __init__(self, filename, lineno, func): | 247 | def __init__(self, filename, lineno, tasks): |
248 | AstNode.__init__(self, filename, lineno) | 248 | AstNode.__init__(self, filename, lineno) |
249 | self.func = func | 249 | self.tasks = tasks |
250 | 250 | ||
251 | def eval(self, data): | 251 | def eval(self, data): |
252 | bb.build.deltask(self.func, data) | 252 | tasks = data.expand(self.tasks).split() |
253 | for task in tasks: | ||
254 | bb.build.deltask(task, data) | ||
253 | 255 | ||
254 | class BBHandlerNode(AstNode): | 256 | class BBHandlerNode(AstNode): |
255 | def __init__(self, filename, lineno, fns): | 257 | def __init__(self, filename, lineno, fns): |
@@ -305,7 +307,7 @@ def handleAddTask(statements, filename, lineno, m): | |||
305 | statements.append(AddTaskNode(filename, lineno, func, before, after)) | 307 | statements.append(AddTaskNode(filename, lineno, func, before, after)) |
306 | 308 | ||
307 | def handleDelTask(statements, filename, lineno, m): | 309 | def handleDelTask(statements, filename, lineno, m): |
308 | func = m.group("func") | 310 | func = m.group(1) |
309 | if func is None: | 311 | if func is None: |
310 | return | 312 | return |
311 | 313 | ||