aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/parse/parse_py/BBHandler.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-14 13:53:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-21 10:55:22 +0000
commit79c00fabe08b4c210a3bd81cfaffbc47ffdc2e2b (patch)
treedffabfe371fab68ecd5550f5a7a0b0ee45d5446f /lib/bb/parse/parse_py/BBHandler.py
parent7e3a99949358f4362876df5a82f8aeaae72c3c97 (diff)
downloadbitbake-79c00fabe08b4c210a3bd81cfaffbc47ffdc2e2b.tar.gz
bitbake: BBHandler/ConfHandler: Improve multiline comment handling
Faced with an expression like: # Some comment \ FOO = "bar" what should bitbake do? Technically, the \ character means its multiline and currently the code treats this as a continuation of the comment. This can surprise some people and is not intuitive. This patch makes bitbake simply error and asks the user to be clearer about what they mean. (Bitbake rev: 589d31ce41e019ee6a7cb6527d67bc76c0b6382a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/parse/parse_py/BBHandler.py')
-rw-r--r--lib/bb/parse/parse_py/BBHandler.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bb/parse/parse_py/BBHandler.py b/lib/bb/parse/parse_py/BBHandler.py
index c585b60fe..88ad03960 100644
--- a/lib/bb/parse/parse_py/BBHandler.py
+++ b/lib/bb/parse/parse_py/BBHandler.py
@@ -200,7 +200,10 @@ def feeder(lineno, s, fn, root, statements):
if s and 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))
+ bb.fatal("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 len(__residue__) != 0 and __residue__[0][0] == "#" and s[0] != "#":
+ bb.fatal("There is a confusing multiline, partially commented expression on line %s of file %s (%s).\nPlease clarify whether this is all a comment or should be parsed." % (lineno, fn, s))
if s and s[-1] == '\\':
__residue__.append(s[:-1])