diff options
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 9dba5f2334..314e8021f9 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
@@ -42,7 +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(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") | 44 | __addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") |
45 | __deltask_regexp__ = re.compile(r"deltask\s+(?P<func>\w+)") | 45 | __deltask_regexp__ = re.compile(r"deltask\s+(?P<func>\w+)(?P<ignores>.*)") |
46 | __addhandler_regexp__ = re.compile(r"addhandler\s+(.+)" ) | 46 | __addhandler_regexp__ = re.compile(r"addhandler\s+(.+)" ) |
47 | __def_regexp__ = re.compile(r"def\s+(\w+).*:" ) | 47 | __def_regexp__ = re.compile(r"def\s+(\w+).*:" ) |
48 | __python_func_regexp__ = re.compile(r"(\s+.*)|(^$)|(^#)" ) | 48 | __python_func_regexp__ = re.compile(r"(\s+.*)|(^$)|(^#)" ) |
@@ -236,11 +236,27 @@ def feeder(lineno, s, fn, root, statements, eof=False): | |||
236 | 236 | ||
237 | m = __addtask_regexp__.match(s) | 237 | m = __addtask_regexp__.match(s) |
238 | if m: | 238 | if m: |
239 | if len(m.group().split()) == 2: | ||
240 | # Check and warn for "addtask task1 task2" | ||
241 | m2 = re.match(r"addtask\s+(?P<func>\w+)(?P<ignores>.*)", s) | ||
242 | if m2 and m2.group('ignores'): | ||
243 | logger.warning('addtask ignored: "%s"' % m2.group('ignores')) | ||
244 | |||
245 | # Check and warn for "addtask task1 before task2 before task3", the | ||
246 | # similar to "after" | ||
247 | taskexpression = s.split() | ||
248 | for word in ('before', 'after'): | ||
249 | if taskexpression.count(word) > 1: | ||
250 | logger.warning("addtask contained multiple '%s' keywords, only one is supported" % word) | ||
251 | |||
239 | ast.handleAddTask(statements, fn, lineno, m) | 252 | ast.handleAddTask(statements, fn, lineno, m) |
240 | return | 253 | return |
241 | 254 | ||
242 | m = __deltask_regexp__.match(s) | 255 | m = __deltask_regexp__.match(s) |
243 | if m: | 256 | if m: |
257 | # Check and warn "for deltask task1 task2" | ||
258 | if m.group('ignores'): | ||
259 | logger.warning('deltask ignored: "%s"' % m.group('ignores')) | ||
244 | ast.handleDelTask(statements, fn, lineno, m) | 260 | ast.handleDelTask(statements, fn, lineno, m) |
245 | return | 261 | return |
246 | 262 | ||