diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-27 23:07:28 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-28 11:15:04 +0100 |
commit | b85c30bb7d47dd8e9bea0e11029c0b08466603b0 (patch) | |
tree | 85e0ead90aea5bfb12bdadb87363267f374c5e38 /bitbake | |
parent | 649048e5376baeb84a697dc640c90829ccc5796e (diff) | |
download | poky-b85c30bb7d47dd8e9bea0e11029c0b08466603b0.tar.gz |
bitbake: parse/ConfHandler: Add negative lookahead to spot some quoting problems
Syntax like:
FOO = "bar" # eek"
would result in FOO taking the value 'bar" #eek' which is clearly
not the intention. Whilst our metadata is riddled with mixtures of even
quotes like:
FOO = "d.getVar("X")"
odd numbers of quotes seem rare. This patch adds detection of one odd
quote which we don't have any of in OE-Core so it seems a valid sanity
improvement.
(Bitbake rev: 5f892d9b083550e20e37576070ec7d1a94cc88fe)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index 6f77bd4201..dbc6776c89 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py | |||
@@ -29,7 +29,7 @@ import logging | |||
29 | import bb.utils | 29 | import bb.utils |
30 | from bb.parse import ParseError, resolve_file, ast, logger | 30 | from bb.parse import ParseError, resolve_file, ast, logger |
31 | 31 | ||
32 | __config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}/]+)(\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?\s*((?P<colon>:=)|(?P<lazyques>\?\?=)|(?P<ques>\?=)|(?P<append>\+=)|(?P<prepend>=\+)|(?P<predot>=\.)|(?P<postdot>\.=)|=)\s*(?P<apo>['\"])(?P<value>.*)(?P=apo)$") | 32 | __config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}/]+)(\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?\s*((?P<colon>:=)|(?P<lazyques>\?\?=)|(?P<ques>\?=)|(?P<append>\+=)|(?P<prepend>=\+)|(?P<predot>=\.)|(?P<postdot>\.=)|=)\s*(?!'[^']*'[^']*'$)(?!\"[^\"]*\"[^\"]*\"$)(?P<apo>['\"])(?P<value>.*)(?P=apo)$") |
33 | __include_regexp__ = re.compile( r"include\s+(.+)" ) | 33 | __include_regexp__ = re.compile( r"include\s+(.+)" ) |
34 | __require_regexp__ = re.compile( r"require\s+(.+)" ) | 34 | __require_regexp__ = re.compile( r"require\s+(.+)" ) |
35 | __export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" ) | 35 | __export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" ) |