path: root/meta/lib
diff options
authorgrygorii tertychnyi via Openembedded-core <>2018-10-10 16:26:24 (GMT)
committerRichard Purdie <>2018-10-11 22:06:35 (GMT)
commitbc8f229366eda5c920f5dfffd3612f951d5ba2b7 (patch)
treec5812c62118311318600b9c08fc5dd1115c0a293 /meta/lib
parent55fe5156ea7ff28e5f02f52eb99b73654050ecaa (diff)
lib/oe/utils: add eol to format_pkg_list()
Append '\n' to the non-empty 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. (From OE-Core rev: ee4d0c879713ba50dc6cc3300f44647faebee2e0) Signed-off-by: grygorii tertychnyi <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'meta/lib')
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/lib/oe/ b/meta/lib/oe/
index 93b0763..d05f517 100644
--- a/meta/lib/oe/
+++ b/meta/lib/oe/
@@ -347,7 +347,13 @@ def format_pkg_list(pkg_dict, ret_format=None):
347 for pkg in sorted(pkg_dict): 347 for pkg in sorted(pkg_dict):
348 output.append(pkg) 348 output.append(pkg)
349 349
350 return '\n'.join(output) 350 output_str = '\n'.join(output)
352 if output_str:
353 # make sure last line is newline terminated
354 output_str += '\n'
356 return output_str
351 357
352def host_gcc_version(d, taskcontextonly=False): 358def host_gcc_version(d, taskcontextonly=False):
353 import re, subprocess 359 import re, subprocess