diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2018-11-14 17:46:41 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-19 17:03:25 +0000 |
commit | 6ac57237697b4ffff86f7c843b70a05996ba51bd (patch) | |
tree | 8ba8581c73355480f82134f0f77231c5b5d3e1af /bitbake | |
parent | 5a485dc01403a840c93fba7e7e3656172482d985 (diff) | |
download | poky-6ac57237697b4ffff86f7c843b70a05996ba51bd.tar.gz |
bitbake: BBHandler: Fix __python_func_regexp__ for comment lines
Fixed:
- Add a comment in base.bbclass:
def oe_import(d):
import sys
# Comment
bbpath = d.getVar("BBPATH").split(":")
[snip]
Note, '# Comment' is started with '#', it is legal in python's syntax
(though maybe not a good style), but bitbake reported errors:
$ bitbake -p
ERROR: ParseError at /path/to/base.bbclass:20: unparsed line: ' bbpath = d.getVar("BBPATH").split(":")'
This error report would mislead people, the real problem is that '# Comment'
is not supported, but it reports the next line, this may make it hard to debug
the code are complicated.
We can make __python_func_regexp__ handle '^#' to fix the problem, since it
already can handle blank line "^$" in a python function, so it would be pretty
safe to handle "^#" as well.
(Bitbake rev: 79e62eef1c93f742bf71e9f25db57fdd2ffedd02)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index e5039e3bd1..01fc47e512 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
@@ -45,7 +45,7 @@ __addtask_regexp__ = re.compile("addtask\s+(?P<func>\w+)\s*((before\s*(?P< | |||
45 | __deltask_regexp__ = re.compile("deltask\s+(?P<func>\w+)") | 45 | __deltask_regexp__ = re.compile("deltask\s+(?P<func>\w+)") |
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+.*)|(^$)|(^#)" ) |
49 | 49 | ||
50 | __infunc__ = [] | 50 | __infunc__ = [] |
51 | __inpython__ = False | 51 | __inpython__ = False |