[bitbake-devel] [PATCH 2/3] data.py: avoid double newlines at the end of functions in emit_var()

Andre McCurdy armccurdy at gmail.com
Thu Jan 28 00:43:17 UTC 2016


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 at gmail.com>
---
 lib/bb/data.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/bb/data.py b/lib/bb/data.py
index fac57da..70ba56b 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -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
 
-- 
1.9.1




More information about the bitbake-devel mailing list