* [PATCH] lib/oe/utils: add eol to format_pkg_list()
@ 2018-10-01 15:47 grygorii tertychnyi
2018-10-03 14:23 ` Richard Purdie
0 siblings, 1 reply; 4+ messages in thread
From: grygorii tertychnyi @ 2018-10-01 15:47 UTC (permalink / raw)
To: openembedded-core; +Cc: xe-linux-external
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] lib/oe/utils: add eol to format_pkg_list()
2018-10-01 15:47 [PATCH] lib/oe/utils: add eol to format_pkg_list() grygorii tertychnyi
@ 2018-10-03 14:23 ` Richard Purdie
2018-10-03 17:22 ` Grygorii Tertychnyi (gtertych)
0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2018-10-03 14:23 UTC (permalink / raw)
To: grygorii tertychnyi, openembedded-core; +Cc: xe-linux-external
On Mon, 2018-10-01 at 18:47 +0300, grygorii tertychnyi via
Openembedded-core wrote:
> 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(-)
If you enable buildhistory (INHERIT += 'buildhistory' in local.conf)
and then "bitbake buildtools-tarball", you'll see:
| DEBUG: Python function buildhistory_list_installed_sdk_target finished
| NOTE: Executing buildhistory_get_sdk_installed_target ...
| DEBUG: Executing shell function buildhistory_get_sdk_installed_target
| basename: missing operand
| Try 'basename --help' for more information.
| WARNING: /home/pokybuild/yocto-worker/nightly-arm/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-tarball/1.0-r0/temp/run.buildhistory_get_sdk_installed_target.13414:1 exit 123 from 'xargs -n1 basename > $1/installed-packages.txt'
| DEBUG: Python function do_populate_sdk finished
| ERROR: Function failed: buildhistory_get_sdk_installed_target (log file is located at /home/pokybuild/yocto-worker/nightly-arm/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-tarball/1.0-r0/temp/log.do_populate_sdk.13414)
which is buildhistory choking on the blank line.
Cheers,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] lib/oe/utils: add eol to format_pkg_list()
2018-10-03 14:23 ` Richard Purdie
@ 2018-10-03 17:22 ` Grygorii Tertychnyi (gtertych)
2018-10-04 5:33 ` Grygorii Tertychnyi (gtertych)
0 siblings, 1 reply; 4+ messages in thread
From: Grygorii Tertychnyi (gtertych) @ 2018-10-03 17:22 UTC (permalink / raw)
To: Richard Purdie, openembedded-core@lists.openembedded.org
Cc: xe-linux-external(mailer list)
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Sent: Wednesday, October 3, 2018 5:23 PM
gt> Append '\n' to the formatted string before return. If you write it
gt> to the (manifest) file, it will ensure file ends with a newline.
gt>
gt> Many GNU utilities have problems processing the last line of a file
gt> if it is not '\n' terminated. E.g. if the last line is not terminated
gt> by a newline character, then "read" will read it but return false,
gt> leaving the broken partial line in the read variable(s).
gt> It can also break or adversely affect some text processing tools,
gt> that operate on the file.
gt>
gt> Signed-off-by: grygorii tertychnyi <gtertych@cisco.com>
gt> ---
gt> meta/lib/oe/utils.py | 2 +-
gt> 1 file changed, 1 insertion(+), 1 deletion(-)
RP> If you enable buildhistory (INHERIT += 'buildhistory' in local.conf)
RP> and then "bitbake buildtools-tarball", you'll see:
RP> | DEBUG: Python function buildhistory_list_installed_sdk_target finished
RP> | NOTE: Executing buildhistory_get_sdk_installed_target ...
RP> | DEBUG: Executing shell function buildhistory_get_sdk_installed_target
RP> | basename: missing operand
RP> | Try 'basename --help' for more information.
RP> | WARNING: /home/pokybuild/yocto-worker/nightly-arm/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-tarball/1.0-r0/temp/run.buildhistory_get_sdk_installed_target.13414:1 exit 123 from 'xargs -n1 basename > $1/installed-packages.txt'
RP> | DEBUG: Python function do_populate_sdk finished
RP> | ERROR: Function failed: buildhistory_get_sdk_installed_target (log file is located at /home/pokybuild/yocto-worker/nightly-arm/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-tarball/1.0-r0/temp/log.do_populate_sdk.13414)
RP> which is buildhistory choking on the blank line.
chances are that we need to revert 98230d2d049c742c349f35b256b13afbc3d26235
to avoid empty lines
let me check
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] lib/oe/utils: add eol to format_pkg_list()
2018-10-03 17:22 ` Grygorii Tertychnyi (gtertych)
@ 2018-10-04 5:33 ` Grygorii Tertychnyi (gtertych)
0 siblings, 0 replies; 4+ messages in thread
From: Grygorii Tertychnyi (gtertych) @ 2018-10-04 5:33 UTC (permalink / raw)
To: Richard Purdie, openembedded-core@lists.openembedded.org
Cc: xe-linux-external(mailer list)
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Sent: Wednesday, October 3, 2018 5:23 PM
gt> Append '\n' to the formatted string before return. If you write it
gt> to the (manifest) file, it will ensure file ends with a newline.
gt>
gt> Many GNU utilities have problems processing the last line of a file
gt> if it is not '\n' terminated. E.g. if the last line is not terminated
gt> by a newline character, then "read" will read it but return false,
gt> leaving the broken partial line in the read variable(s).
gt> It can also break or adversely affect some text processing tools,
gt> that operate on the file.
gt>
gt> Signed-off-by: grygorii tertychnyi <gtertych@cisco.com>
gt> ---
gt> meta/lib/oe/utils.py | 2 +-
gt> 1 file changed, 1 insertion(+), 1 deletion(-)
RP> If you enable buildhistory (INHERIT += 'buildhistory' in local.conf)
RP> and then "bitbake buildtools-tarball", you'll see:
RP> | DEBUG: Python function buildhistory_list_installed_sdk_target finished
RP> | NOTE: Executing buildhistory_get_sdk_installed_target ...
RP> | DEBUG: Executing shell function buildhistory_get_sdk_installed_target
RP> | basename: missing operand
RP> | Try 'basename --help' for more information.
RP> | WARNING: /home/pokybuild/yocto-worker/nightly-arm/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-tarball/1.0-r0/temp/run.buildhistory_get_sdk_installed_target.13414:1 exit 123 from 'xargs -n1 basename > $1/installed-packages.txt'
RP> | DEBUG: Python function do_populate_sdk finished
RP> | ERROR: Function failed: buildhistory_get_sdk_installed_target (log file is located at /home/pokybuild/yocto-worker/nightly-arm/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-tarball/1.0-r0/temp/log.do_populate_sdk.13414)
RP> which is buildhistory choking on the blank line.
Reworked in v2. Now it is built.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-04 5:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-01 15:47 [PATCH] lib/oe/utils: add eol to format_pkg_list() grygorii tertychnyi
2018-10-03 14:23 ` Richard Purdie
2018-10-03 17:22 ` Grygorii Tertychnyi (gtertych)
2018-10-04 5:33 ` Grygorii Tertychnyi (gtertych)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox