diff options
author | Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> | 2021-02-06 21:42:38 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-07-30 14:37:25 +0100 |
commit | 9df61675f0e9bb67a78bfa1a16b1cf9fa4c333f1 (patch) | |
tree | 830ae0af6b87b86a294eefb50529f3cb91150ff1 /lib/bb/parse/parse_py/BBHandler.py | |
parent | 0e0af15b84e07e6763300dcd092b980086b9b9c4 (diff) | |
download | bitbake-contrib-9df61675f0e9bb67a78bfa1a16b1cf9fa4c333f1.tar.gz |
BBHandler: Don't classify shell functions that names start with "python*" as python function
If shell function name starts with 'python' or 'fakeroot' parser wrongly
assumes it's python/fakeroot function.
[YOCTO #14204]
Use regex lookahead assertions to check if 'python' expression is
followed by whitespace or '(' and if 'fakeroot' is followed by
whitespace.
Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/parse/parse_py/BBHandler.py')
-rw-r--r-- | lib/bb/parse/parse_py/BBHandler.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/parse/parse_py/BBHandler.py b/lib/bb/parse/parse_py/BBHandler.py index 6e216effb..20252c519 100644 --- a/lib/bb/parse/parse_py/BBHandler.py +++ b/lib/bb/parse/parse_py/BBHandler.py @@ -22,7 +22,7 @@ from .ConfHandler import include, init # For compatibility bb.deprecate_import(__name__, "bb.parse", ["vars_from_file"]) -__func_start_regexp__ = re.compile(r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" ) +__func_start_regexp__ = re.compile(r"(((?P<py>python(?=(\s|\()))|(?P<fr>fakeroot(?=\s)))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" ) __inherit_regexp__ = re.compile(r"inherit\s+(.+)" ) __export_func_regexp__ = re.compile(r"EXPORT_FUNCTIONS\s+(.+)" ) __addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") |