summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-27 23:07:28 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-28 11:15:04 +0100
commitb85c30bb7d47dd8e9bea0e11029c0b08466603b0 (patch)
tree85e0ead90aea5bfb12bdadb87363267f374c5e38
parent649048e5376baeb84a697dc640c90829ccc5796e (diff)
downloadpoky-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>
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py2
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
29import bb.utils 29import bb.utils
30from bb.parse import ParseError, resolve_file, ast, logger 30from 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\-_+.${}/]+)$" )