From b85c30bb7d47dd8e9bea0e11029c0b08466603b0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 27 Sep 2012 23:07:28 +0100 Subject: 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 --- bitbake/lib/bb/parse/parse_py/ConfHandler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bitbake') 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 import bb.utils from bb.parse import ParseError, resolve_file, ast, logger -__config_regexp__ = re.compile( r"(?Pexport\s*)?(?P[a-zA-Z0-9\-_+.${}/]+)(\[(?P[a-zA-Z0-9\-_+.]+)\])?\s*((?P:=)|(?P\?\?=)|(?P\?=)|(?P\+=)|(?P=\+)|(?P=\.)|(?P\.=)|=)\s*(?P['\"])(?P.*)(?P=apo)$") +__config_regexp__ = re.compile( r"(?Pexport\s*)?(?P[a-zA-Z0-9\-_+.${}/]+)(\[(?P[a-zA-Z0-9\-_+.]+)\])?\s*((?P:=)|(?P\?\?=)|(?P\?=)|(?P\+=)|(?P=\+)|(?P=\.)|(?P\.=)|=)\s*(?!'[^']*'[^']*'$)(?!\"[^\"]*\"[^\"]*\"$)(?P['\"])(?P.*)(?P=apo)$") __include_regexp__ = re.compile( r"include\s+(.+)" ) __require_regexp__ = re.compile( r"require\s+(.+)" ) __export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" ) -- cgit v1.2.3-54-g00ecf