summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-22 21:45:26 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-22 21:45:28 +0000
commitc0f0a8ee0cac5b6dd7c7a7e584309f862e49f536 (patch)
tree88539e45445b2d9408da7d6623bcf2a8f3340032 /bitbake/lib
parentbe9262233975911e404f6fcdb3c81ba916d28e32 (diff)
downloadpoky-c0f0a8ee0cac5b6dd7c7a7e584309f862e49f536.tar.gz
bitbake/BBHandler: Improve handling of multiline comments and warn users of the change
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 31d1e21c67..402cd07e2a 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -193,9 +193,14 @@ def feeder(lineno, s, fn, root, statements):
193 if lineno == IN_PYTHON_EOF: 193 if lineno == IN_PYTHON_EOF:
194 return 194 return
195 195
196# fall through
197 196
198 if s == '' or s[0] == '#': return # skip comments and empty lines 197 # Skip empty lines
198 if s == '':
199 return
200
201 if s[0] == '#':
202 if len(__residue__) != 0 and __residue__[0][0] != "#":
203 bb.error("There is a comment on line %s of file %s (%s) which is in the middle of a multiline expression.\nBitbake used to ignore these but no longer does so, please fix your metadata as errors are likely as a result of this change." % (lineno, fn, s))
199 204
200 if s[-1] == '\\': 205 if s[-1] == '\\':
201 __residue__.append(s[:-1]) 206 __residue__.append(s[:-1])
@@ -204,6 +209,10 @@ def feeder(lineno, s, fn, root, statements):
204 s = "".join(__residue__) + s 209 s = "".join(__residue__) + s
205 __residue__ = [] 210 __residue__ = []
206 211
212 # Skip comments
213 if s[0] == '#':
214 return
215
207 m = __func_start_regexp__.match(s) 216 m = __func_start_regexp__.match(s)
208 if m: 217 if m:
209 __infunc__ = m.group("func") or "__anonymous" 218 __infunc__ = m.group("func") or "__anonymous"