summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/context.py
diff options
context:
space:
mode:
authorChristos Gavros <gavrosc@yahoo.com>2025-02-25 18:56:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-02-27 10:55:17 +0000
commitde51bc3cd9289484c35361b38ccc86420c4ef99f (patch)
treeeba2e2f376255616b586a7a21efa3f6cc13e1a81 /meta/lib/oeqa/selftest/context.py
parente004154042c674e9f647a2991fb99245f5bba753 (diff)
downloadpoky-de51bc3cd9289484c35361b38ccc86420c4ef99f.tar.gz
oeqa/selftest: add a newline in local.conf (newbuilddir)
If the build-st/conf/local.conf does not end with a newline when is generated then add one [YOCTO #15734] CC: Yoann Congal <yoann.congal@smile.fr> CC: Randy MacLeod <randy.macleod@windriver.com> CC: Alexander Kanavin <alex.kanavin@gmail.com> (From OE-Core rev: d2fcd9e880126bc33be2ef14e678cc1aa72683c3) Signed-off-by: Christos Gavros <gavrosc@yahoo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/context.py')
-rw-r--r--meta/lib/oeqa/selftest/context.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py
index 5eb4cc44fd..16f82c6737 100644
--- a/meta/lib/oeqa/selftest/context.py
+++ b/meta/lib/oeqa/selftest/context.py
@@ -102,6 +102,13 @@ class OESelftestTestContext(OETestContext):
102 oe.path.copytree(builddir + "/cache", newbuilddir + "/cache") 102 oe.path.copytree(builddir + "/cache", newbuilddir + "/cache")
103 oe.path.copytree(selftestdir, newselftestdir) 103 oe.path.copytree(selftestdir, newselftestdir)
104 104
105 # if the last line of local.conf in newbuilddir is not empty and does not end with newline then add one
106 localconf_path = newbuilddir + "/conf/local.conf"
107 with open(localconf_path, "r+", encoding="utf-8") as f:
108 last_line = f.readlines()[-1]
109 if last_line and not last_line.endswith("\n"):
110 f.write("\n")
111
105 subprocess.check_output("git init && git add * && git commit -a -m 'initial'", cwd=newselftestdir, shell=True) 112 subprocess.check_output("git init && git add * && git commit -a -m 'initial'", cwd=newselftestdir, shell=True)
106 113
107 # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow 114 # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow