oeqa/selftest: add a newline in local.conf (newbuilddir)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/1 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
Fixes [YOCTO #15734]
---v1->v2
* the comment is changed
* last_line is initialized to "None"
* add a new line by using f.write("\n")
--- meta/lib/oeqa/selftest/context.py | 9 +++++++++ 1 file changed, 9 insertions(+)
meta/lib/oeqa/selftest/context.py +9 -0
@@ -102,6 +102,15 @@ class OESelftestTestContext(OETestContext): oe.path.copytree(builddir + "/cache", newbuilddir + "/cache") oe.path.copytree(selftestdir, newselftestdir) + # if the last line of local.conf in newbuilddir is not empty and does not end with newline then add one + localconf_path = newbuilddir + "/conf/local.conf" + with open(localconf_path, "r+", encoding="utf-8") as f: + last_line = None + for line in f: + last_line = line + if last_line and not last_line.endswith("\n"): + f.write("\n") + subprocess.check_output("git init && git add * && git commit -a -m 'initial'", cwd=newselftestdir, shell=True) # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow
Signature · 1 line
2.34.1
meta/lib/oeqa/selftest/context.py class OESelftestTestContext(OETestContext): · line 110
Quoted 6 lines · Christos Gavros via lists.openembedded.org
meta/lib/oeqa/selftest/context.py +6
-0+ # if the last line of local.conf in newbuilddir is not empty and does not end with newline then add one + localconf_path = newbuilddir + "/conf/local.conf" + with open(localconf_path, "r+", encoding="utf-8") as f: + last_line = None + for line in f: + last_line = line
You can replace this with 'last_line = f.readlines()[-1]'.
Alex
Hello Chistos,
Quoted 7 lines · Christos Gavros
If the
build-st/conf/local.confdoes not end with a newline when is generated then add one
Fixes [YOCTO #15734]CC Randy MacLeod <[email protected]>Reviewed-by Yoann Congal <[email protected]>
FYI, you can't add a Reviewed-by from someone without an explicit email (Often stating the full line "Reviewed-by: Xxx Yyy <...@...>"). On your v1, I merely commented, that is not sufficient for adding my reviewed-by.
Quoted 37 lines
---
v1->v2
* the comment is changed
*last_lineis initialized to "None"
* add a new line by usingf.write("\n")--- meta/lib/oeqa/selftest/context.py | 9 +++++++++ 1 file changed, 9 insertions(+)meta/lib/oeqa/selftest/context.py +1
-0@@ -102,6 +102,15 @@ class OESelftestTestContext(OETestContext): oe.path.copytree(builddir + "/cache", newbuilddir + "/cache") oe.path.copytree(selftestdir, newselftestdir) + # if the last line of local.conf in newbuilddir is not empty anddoes not end with newline then add one
meta/lib/oeqa/selftest/context.py +8
-1+ localconf_path = newbuilddir + "/conf/local.conf" + with open(localconf_path, "r+", encoding="utf-8") as f: + last_line = None + for line in f: + last_line = line + if last_line and not last_line.endswith("\n"): + f.write("\n") + subprocess.check_output("git init && git add * && git commit -a -m 'initial'", cwd=newselftestdir, shell=True) # Tried to used bitbake-layers add/remove but it requires recipeparsing and hence is too slow
--
2.34.1
Signature · 2 lines
Yoann Congal Smile ECS - Tech expert