From 83e101568434a099c8d9a3e626c3a37589c3a233 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 14 Feb 2013 10:31:12 +0000 Subject: bitbake: ConfHandler: Improve regexp to fix mis-parsing of += and no whitespace If you have: FOO = "a" FOO += "b" FOO+= "c" The expected result is "a b c" however we were seeing "a b" with the FOO+ variable being assigned the value "c". This isn't the expected result. We need to make the name part of the variale non-greedy so that any + character becomes part of the operator. This patch does that. I compared the configuration in OE-Core before and after the change and only the test case changed. [YOCTO #3834] (Bitbake rev: 2cd8d7fd12a646e6516e2c985e6a54121d19eb59) 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 b3d10c6c7d..4b62a3a5eb 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