summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/parse/ast.py10
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py5
-rw-r--r--bitbake/lib/bb/tests/parse.py6
3 files changed, 11 insertions, 10 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
246class DelTaskNode(AstNode): 246class 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
254class BBHandlerNode(AstNode): 256class 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
307def handleDelTask(statements, filename, lineno, m): 309def 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
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 6e216effb8..215f940b60 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -26,7 +26,7 @@ __func_start_regexp__ = re.compile(r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(
26__inherit_regexp__ = re.compile(r"inherit\s+(.+)" ) 26__inherit_regexp__ = re.compile(r"inherit\s+(.+)" )
27__export_func_regexp__ = re.compile(r"EXPORT_FUNCTIONS\s+(.+)" ) 27__export_func_regexp__ = re.compile(r"EXPORT_FUNCTIONS\s+(.+)" )
28__addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") 28__addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*")
29__deltask_regexp__ = re.compile(r"deltask\s+(?P<func>\w+)(?P<ignores>.*)") 29__deltask_regexp__ = re.compile(r"deltask\s+(.+)")
30__addhandler_regexp__ = re.compile(r"addhandler\s+(.+)" ) 30__addhandler_regexp__ = re.compile(r"addhandler\s+(.+)" )
31__def_regexp__ = re.compile(r"def\s+(\w+).*:" ) 31__def_regexp__ = re.compile(r"def\s+(\w+).*:" )
32__python_func_regexp__ = re.compile(r"(\s+.*)|(^$)|(^#)" ) 32__python_func_regexp__ = re.compile(r"(\s+.*)|(^$)|(^#)" )
@@ -238,9 +238,6 @@ def feeder(lineno, s, fn, root, statements, eof=False):
238 238
239 m = __deltask_regexp__.match(s) 239 m = __deltask_regexp__.match(s)
240 if m: 240 if m:
241 # Check and warn "for deltask task1 task2"
242 if m.group('ignores'):
243 logger.warning('deltask ignored: "%s"' % m.group('ignores'))
244 ast.handleDelTask(statements, fn, lineno, m) 241 ast.handleDelTask(statements, fn, lineno, m)
245 return 242 return
246 243
diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py
index 9afd1b208e..9e21e18425 100644
--- a/bitbake/lib/bb/tests/parse.py
+++ b/bitbake/lib/bb/tests/parse.py
@@ -178,7 +178,10 @@ python () {
178addtask do_patch after do_foo after do_unpack before do_configure before do_compile 178addtask do_patch after do_foo after do_unpack before do_configure before do_compile
179addtask do_fetch do_patch 179addtask do_fetch do_patch
180 180
181deltask do_fetch do_patch 181MYVAR = "do_patch"
182EMPTYVAR = ""
183deltask do_fetch ${MYVAR} ${EMPTYVAR}
184deltask ${EMPTYVAR}
182""" 185"""
183 def test_parse_addtask_deltask(self): 186 def test_parse_addtask_deltask(self):
184 import sys 187 import sys
@@ -189,6 +192,5 @@ deltask do_fetch do_patch
189 self.assertTrue("addtask contained multiple 'before' keywords" in stdout) 192 self.assertTrue("addtask contained multiple 'before' keywords" in stdout)
190 self.assertTrue("addtask contained multiple 'after' keywords" in stdout) 193 self.assertTrue("addtask contained multiple 'after' keywords" in stdout)
191 self.assertTrue('addtask ignored: " do_patch"' in stdout) 194 self.assertTrue('addtask ignored: " do_patch"' in stdout)
192 self.assertTrue('deltask ignored: " do_patch"' in stdout)
193 #self.assertTrue('dependent task do_foo for do_patch does not exist' in stdout) 195 #self.assertTrue('dependent task do_foo for do_patch does not exist' in stdout)
194 196