Openembedded Core Discussions
 help / color / mirror / Atom feed
From: grygorii tertychnyi <gtertych@cisco.com>
To: openembedded-core@lists.openembedded.org
Cc: xe-linux-external@cisco.com
Subject: [PATCH] lib/oe/utils: add eol to format_pkg_list()
Date: Mon,  1 Oct 2018 18:47:23 +0300	[thread overview]
Message-ID: <20181001154723.32161-1-gtertych@cisco.com> (raw)

Append '\n' to the formatted string before return. If you write it
to the (manifest) file, it will ensure file ends with a newline.

Many GNU utilities have problems processing the last line of a file
if it is not '\n' terminated. E.g. if the last line is not terminated
by a newline character, then "read" will read it but return false,
leaving the broken partial line in the read variable(s).
It can also break or adversely affect some text processing tools,
that operate on the file.

Signed-off-by: grygorii tertychnyi <gtertych@cisco.com>
---
 meta/lib/oe/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 93b0763b0a..cd12ce5263 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -347,7 +347,7 @@ def format_pkg_list(pkg_dict, ret_format=None):
         for pkg in sorted(pkg_dict):
             output.append(pkg)
 
-    return '\n'.join(output)
+    return '\n'.join(output) + '\n'
 
 def host_gcc_version(d, taskcontextonly=False):
     import re, subprocess
-- 
2.19.0



             reply	other threads:[~2018-10-01 15:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 15:47 grygorii tertychnyi [this message]
2018-10-03 14:23 ` [PATCH] lib/oe/utils: add eol to format_pkg_list() Richard Purdie
2018-10-03 17:22   ` Grygorii Tertychnyi (gtertych)
2018-10-04  5:33     ` Grygorii Tertychnyi (gtertych)

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=20181001154723.32161-1-gtertych@cisco.com \
    --to=gtertych@cisco.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=xe-linux-external@cisco.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox