All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre McCurdy <armccurdy@gmail.com>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH 2/3] data.py: avoid double newlines at the end of functions in emit_var()
Date: Wed, 27 Jan 2016 16:43:17 -0800	[thread overview]
Message-ID: <1453941798-11670-3-git-send-email-armccurdy@gmail.com> (raw)
In-Reply-To: <1453941798-11670-1-git-send-email-armccurdy@gmail.com>

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>
---
 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



  parent reply	other threads:[~2016-01-28  0:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  0:43 [PATCH 0/3] improve formatting of OE run.do_configure etc scripts Andre McCurdy
2016-01-28  0:43 ` [PATCH 1/3] build.py: minor shell_trap_code() formatting tweaks Andre McCurdy
2016-01-28  0:43 ` Andre McCurdy [this message]
2016-01-28  0:43 ` [PATCH 3/3] data.py: sort variables being output by emit_func() Andre McCurdy
2016-01-29  0:01   ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453941798-11670-3-git-send-email-armccurdy@gmail.com \
    --to=armccurdy@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.