[bitbake][wrynose][2.18][PATCH 1/2] bitbake-setup: always write newline at end of the README

Yoann Congal <[email protected]> Fri, 17 Jul 2026 11:52:15 +0200
Newsgroups org.openembedded.lists.bitbake-devel
Message-ID <a39c273eb6915ab5a1713695b3fd46c52ecb33bd.1784281828.git.yoann.congal@smile.fr>
From: Ernest Van Hoecke <[email protected]>

When the "readme_extra" string was introduced, we dropped a newline in
the "readme" multiline string. In a Python multiline string, this counts
and therefore we dropped the newline at the end of the README unless
readme_extra is not empty (i.e.: unless the VS Code string is included
which includes a newline).

Put the newline back into the readme string and edit the VS Code extra
string accordingly.

Fixes: 92fd721941fd ("bitbake-setup: generate config files for VSCode")
Signed-off-by: Ernest Van Hoecke <[email protected]>
Signed-off-by: Mathieu Dubois-Briand <[email protected]>
Signed-off-by: Richard Purdie <[email protected]>
(cherry picked from commit 7e6466f48191c1e4ab9b91705deb237eff2c7f01)
Signed-off-by: Yoann Congal <[email protected]>
---
 bin/bitbake-setup | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 220540f7f..4d75ad612 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -415,12 +415,13 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_c
 
     readme_extra = ""
     if init_vscode:
-        readme_extra = "\n\nTo edit the code in VSCode, open the workspace: code {}\n".format(workspace_file)
+        readme_extra = "\nTo edit the code in VSCode, open the workspace: code {}\n".format(workspace_file)
 
     readme = """{}\n\nAdditional information is in {} and {}\n
 Source the environment using '. {}' to run builds from the command line.\n
 {}\n
-The bitbake configuration files (local.conf, bblayers.conf and more) can be found in {}/conf{}""".format(
+The bitbake configuration files (local.conf, bblayers.conf and more) can be found in {}/conf
+{}""".format(
         bitbake_config["description"],
         os.path.join(bitbake_builddir,'conf/conf-summary.txt'),
         os.path.join(bitbake_builddir,'conf/conf-notes.txt'),