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:38:30 +0100 |
commit | 7d3fb188bfe4dc9aebe80286a65b357ed2ae8b8f (patch) | |
tree | 809f53db7a01930796b34bc3ae11c4640df91085 /bitbake/lib | |
parent | 6a751048e50c00261d99c2d8d69534f7a8da38a9 (diff) | |
download | poky-7d3fb188bfe4dc9aebe80286a65b357ed2ae8b8f.tar.gz |
bitbake: 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.
(Bitbake rev: 9bddcd4824ed94915a2b7cf96a13d4ada01c7f9d)
Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-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 215f940b60..ea34f3a327 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
@@ -22,7 +22,7 @@ from .ConfHandler import include, init | |||
22 | # For compatibility | 22 | # For compatibility |
23 | bb.deprecate_import(__name__, "bb.parse", ["vars_from_file"]) | 23 | bb.deprecate_import(__name__, "bb.parse", ["vars_from_file"]) |
24 | 24 | ||
25 | __func_start_regexp__ = re.compile(r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" ) | 25 | __func_start_regexp__ = re.compile(r"(((?P<py>python(?=(\s|\()))|(?P<fr>fakeroot(?=\s)))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\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))|(.*)))))*") |