diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-21 11:00:52 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-21 11:01:53 +0000 |
commit | a5358511b1741e6abff1a8f5136f1c8662645fea (patch) | |
tree | 758d87edf8975ed220c15898e6f0005818ba03df /bitbake/lib/bb/parse/parse_py | |
parent | 73dc22b728dde0fb76092790ff0fcbb6b326a42d (diff) | |
download | poky-a5358511b1741e6abff1a8f5136f1c8662645fea.tar.gz |
bitbake: BBHandler/ConfHandler: Merge fix for multiline comments
This was meant to be squashed into the previous commit for multiline comment
handling. It fixes the case the commented multiline is followed by an empty
line which was resulting in a traceback instead of a sane error message.
(Bitbake rev: 7e7d692e244fe8dca533f842ca143b9c821e317c)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py')
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 88ad03960a..81fb8d3adf 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
@@ -202,7 +202,7 @@ def feeder(lineno, s, fn, root, statements): | |||
202 | if len(__residue__) != 0 and __residue__[0][0] != "#": | 202 | if len(__residue__) != 0 and __residue__[0][0] != "#": |
203 | 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)) | 203 | 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)) |
204 | 204 | ||
205 | if len(__residue__) != 0 and __residue__[0][0] == "#" and s[0] != "#": | 205 | if len(__residue__) != 0 and __residue__[0][0] == "#" and (not s or s[0] != "#"): |
206 | 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)) | 206 | 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)) |
207 | 207 | ||
208 | if s and s[-1] == '\\': | 208 | if s and s[-1] == '\\': |
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index 9b09c9f56a..8f3f120ed5 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py | |||
@@ -108,7 +108,7 @@ def handle(fn, data, include): | |||
108 | while s[-1] == '\\': | 108 | while s[-1] == '\\': |
109 | s2 = f.readline().strip() | 109 | s2 = f.readline().strip() |
110 | lineno = lineno + 1 | 110 | lineno = lineno + 1 |
111 | if s2 and s[0] == "#" and s2[0] != "#": | 111 | if (not s2 or s2 and s2[0] != "#") and s[0] == "#" : |
112 | 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)) | 112 | 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)) |
113 | s = s[:-1] + s2 | 113 | s = s[:-1] + s2 |
114 | # skip comments | 114 | # skip comments |