summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2023-03-27 15:59:37 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-28 22:28:45 +0100
commitf5f465ff5777eb99941db3dda84e65d4699d97f7 (patch)
tree9266733c6315d4bde11c60c1ae2239173d6a27a3 /meta
parent4147b7e76d184cb309315e512637da502e665dba (diff)
downloadpoky-f5f465ff5777eb99941db3dda84e65d4699d97f7.tar.gz
oeqa/selftest: OESelftestTestContext: convert relative to full path when newbuilddir is provided
Relative paths in BBLAYERS only works when the new build dir are on the same ascending directory node: . ├── build ├── build-st It works because they share the same ascending relative directory node. So use the full path when the argument newbuilddir is provided to make the oe-selftest work everywere regardless of the location chosen. (From OE-Core rev: 2e022c1977bc1006c00a87e08a2dca5b69db4801) Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/context.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py
index adfb1170db..0a7a9da72a 100644
--- a/meta/lib/oeqa/selftest/context.py
+++ b/meta/lib/oeqa/selftest/context.py
@@ -102,6 +102,16 @@ class OESelftestTestContext(OETestContext):
102 # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow 102 # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow
103 subprocess.check_output("sed %s/conf/bblayers.conf -i -e 's#%s#%s#g'" % (newbuilddir, selftestdir, newselftestdir), cwd=newbuilddir, shell=True) 103 subprocess.check_output("sed %s/conf/bblayers.conf -i -e 's#%s#%s#g'" % (newbuilddir, selftestdir, newselftestdir), cwd=newbuilddir, shell=True)
104 104
105 # Relative paths in BBLAYERS only works when the new build dir share the same ascending node
106 if self.newbuilddir:
107 bblayers = subprocess.check_output("bitbake-getvar --value BBLAYERS | tail -1", cwd=builddir, shell=True, text=True)
108 if '..' in bblayers:
109 bblayers_abspath = [os.path.abspath(path) for path in bblayers.split()]
110 with open("%s/conf/bblayers.conf" % newbuilddir, "a") as f:
111 newbblayers = "# new bblayers to be used by selftest in the new build dir '%s'\n" % newbuilddir
112 newbblayers += 'BBLAYERS = "%s"\n' % ' '.join(bblayers_abspath)
113 f.write(newbblayers)
114
105 for e in os.environ: 115 for e in os.environ:
106 if builddir + "/" in os.environ[e]: 116 if builddir + "/" in os.environ[e]:
107 os.environ[e] = os.environ[e].replace(builddir + "/", newbuilddir + "/") 117 os.environ[e] = os.environ[e].replace(builddir + "/", newbuilddir + "/")