Browse Source

parse/ConfHandler: Fix enthusiatic export regexp matching

The export regexp was only meant to catch values like:

export VARIABLENAME

however after the stricter quoting patch was applied, it was also matching
variables like:

export BAR=foo

and setting the export flag on a variable called "BAR=foo". The = character
is an invalid variable name character. This patch tightens up the regexp
match so it only matches the intended character set and only matches variable
names.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 12 years ago
parent
commit
6d1765c2ea
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/bb/parse/parse_py/ConfHandler.py

+ 1 - 1
lib/bb/parse/parse_py/ConfHandler.py

@@ -32,7 +32,7 @@ from bb.parse import ParseError, resolve_file, ast, logger
 __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)$")
 __include_regexp__ = re.compile( r"include\s+(.+)" )
 __require_regexp__ = re.compile( r"require\s+(.+)" )
-__export_regexp__ = re.compile( r"export\s+(.+)" )
+__export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" )
 
 def init(data):
     topdir = data.getVar('TOPDIR')