]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
data.py: avoid double newlines at the end of functions in emit_var()
authorAndre McCurdy <armccurdy@gmail.com>
Thu, 28 Jan 2016 00:43:17 +0000 (16:43 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 29 Jan 2016 17:06:04 +0000 (17:06 +0000)
A newline is always appended to the function body when it's written
out, so strip any trailing newlines which may be there already.

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/data.py

index fac57da71d857a36deb5d96129b1a6922f797aa7..70ba56b48a01604fca80a4f62901f73c00a9ad08 100644 (file)
@@ -227,6 +227,7 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
 
     if func:
         # NOTE: should probably check for unbalanced {} within the var
+        val = val.rstrip('\n')
         o.write("%s() {\n%s\n}\n" % (varExpanded, val))
         return 1