summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb
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/bb
parentbe9262233975911e404f6fcdb3c81ba916d28e32 (diff)
downloadopenembedded-core-c0f0a8ee0cac5b6dd7c7a7e584309f862e49f536.tar.gz
openembedded-core-c0f0a8ee0cac5b6dd7c7a7e584309f862e49f536.tar.bz2
openembedded-core-c0f0a8ee0cac5b6dd7c7a7e584309f862e49f536.tar.xz
openembedded-core-c0f0a8ee0cac5b6dd7c7a7e584309f862e49f536.zip
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/bb')
-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 31d1e21c6..402cd07e2 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):
if lineno == IN_PYTHON_EOF:
return
-# fall through
- if s == '' or s[0] == '#': return # skip comments and empty lines
+ # Skip empty lines
+ if s == '':
+ return
+
+ if s[0] == '#':
+ if len(__residue__) != 0 and __residue__[0][0] != "#":
+ 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))
if s[-1] == '\\':
__residue__.append(s[:-1])
@@ -204,6 +209,10 @@ def feeder(lineno, s, fn, root, statements):
s = "".join(__residue__) + s
__residue__ = []
+ # Skip comments
+ if s[0] == '#':
+ return
+
m = __func_start_regexp__.match(s)
if m:
__infunc__ = m.group("func") or "__anonymous"