Skip to contentSkip to conversation

data: Add newline after the last export in emit_func

PATCH New Andre McCurdy 1 participant 1 message Jul 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 data: Add newline after the last export in emit_func

Minor formatting improvement in generated shell scripts.

Add a newline after the last export emitted by emit_func. Also, remove chance of putting an extra newline in the middle of the exports, since we never want to do that.

---
 lib/bb/data.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/bb/data.py +2 -1
index 8b21c46..2f90be6 100644
@@ -271,8 +271,9 @@ def emit_func(func, o=sys.__stdout__, d = init()):
 
     keys = (key for key in d.keys() if not key.startswith("__") and not d.getVarFlag(key, "func"))
     for key in keys:
-        emit_var(key, o, d, False) and o.write('\n')
+        emit_var(key, o, d, False)
 
+    o.write('\n')
     emit_var(func, o, d, False) and o.write('\n')
     newdeps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func, True))
     newdeps |= set((d.getVarFlag(func, "vardeps", True) or "").split())
Signature · 1 line
1.9.1