]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
BBHandler/ConfHandler: Merge fix for multiline comments
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Jan 2013 11:00:52 +0000 (11:00 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Jan 2013 11:00:54 +0000 (11:00 +0000)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/parse/parse_py/BBHandler.py
lib/bb/parse/parse_py/ConfHandler.py

index 88ad03960a90d1e7dc3b0fd097d2007211414647..81fb8d3adf8998c5d82e45ba37b05a0a01f6a5d4 100644 (file)
@@ -202,7 +202,7 @@ def feeder(lineno, s, fn, root, statements):
         if len(__residue__) != 0 and __residue__[0][0] != "#":
             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] != "#":
+    if len(__residue__) != 0 and __residue__[0][0] == "#" and (not s or 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] == '\\':
index 9b09c9f56ac1808217327fb4f767c43cae0acb70..8f3f120ed5afd4601b54899b4d1e28bbb25f78b0 100644 (file)
@@ -108,7 +108,7 @@ def handle(fn, data, include):
         while s[-1] == '\\':
             s2 = f.readline().strip()
             lineno = lineno + 1
-            if s2 and s[0] == "#" and s2[0] != "#":
+            if (not s2 or s2 and s2[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))
             s = s[:-1] + s2
         # skip comments