summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorOla x Nilsson <ola.x.nilsson@axis.com>2017-05-31 10:46:48 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-05 09:19:51 +0100
commitca68d71ddc2e3ffc92d6215345a5909b688cc325 (patch)
tree2f440bb59bc5d8157ee6f445ce9c515a3e4a3f44 /bitbake
parent5f711bc63e958bbaac50575d4af956dc9505a874 (diff)
downloadpoky-ca68d71ddc2e3ffc92d6215345a5909b688cc325.tar.gz
bitbake: ConfHandler: Require whitespace between export and variable name
(Bitbake rev: 22bb7c9270f02ddae72e13d849375feee5f4a98b) Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py2
-rw-r--r--bitbake/lib/bb/tests/parse.py23
2 files changed, 23 insertions, 2 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index f7d0cf74ab..bf7e9859ac 100644
--- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -32,7 +32,7 @@ from bb.parse import ParseError, resolve_file, ast, logger, handle
32 32
33__config_regexp__ = re.compile( r""" 33__config_regexp__ = re.compile( r"""
34 ^ 34 ^
35 (?P<exp>export\s*)? 35 (?P<exp>export\s+)?
36 (?P<var>[a-zA-Z0-9\-_+.${}/~]+?) 36 (?P<var>[a-zA-Z0-9\-_+.${}/~]+?)
37 (\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])? 37 (\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?
38 38
diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py
index ab6ca90317..8f16ba4f4c 100644
--- a/bitbake/lib/bb/tests/parse.py
+++ b/bitbake/lib/bb/tests/parse.py
@@ -83,7 +83,28 @@ unset B[flag]
83 self.assertEqual(d.getVar("A"), None) 83 self.assertEqual(d.getVar("A"), None)
84 self.assertEqual(d.getVarFlag("A","flag"), None) 84 self.assertEqual(d.getVarFlag("A","flag"), None)
85 self.assertEqual(d.getVar("B"), "2") 85 self.assertEqual(d.getVar("B"), "2")
86 86
87 exporttest = """
88A = "a"
89export B = "b"
90export C
91exportD = "d"
92"""
93
94 def test_parse_exports(self):
95 f = self.parsehelper(self.exporttest)
96 d = bb.parse.handle(f.name, self.d)['']
97 self.assertEqual(d.getVar("A"), "a")
98 self.assertIsNone(d.getVarFlag("A", "export"))
99 self.assertEqual(d.getVar("B"), "b")
100 self.assertEqual(d.getVarFlag("B", "export"), 1)
101 self.assertIsNone(d.getVar("C"))
102 self.assertEqual(d.getVarFlag("C", "export"), 1)
103 self.assertIsNone(d.getVar("D"))
104 self.assertIsNone(d.getVarFlag("D", "export"))
105 self.assertEqual(d.getVar("exportD"), "d")
106 self.assertIsNone(d.getVarFlag("exportD", "export"))
107
87 108
88 overridetest = """ 109 overridetest = """
89RRECOMMENDS_${PN} = "a" 110RRECOMMENDS_${PN} = "a"