diff options
author | Jose Quaresma <quaresma.jose@gmail.com> | 2023-03-27 15:59:37 +0000 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-04-14 06:30:29 -1000 |
commit | 980e07f0960167babfbcb5b29c6cdaa5111f9c1a (patch) | |
tree | 7c5bb6e388fa20f29f55f8a3dc5e5114d8152290 /meta | |
parent | ee5fc31a7490cae999ec4ccc21367eb95f714261 (diff) | |
download | poky-980e07f0960167babfbcb5b29c6cdaa5111f9c1a.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: 41f169ea23078cc8f4a6b6fc6b59230f05cb758b)
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 2e022c1977bc1006c00a87e08a2dca5b69db4801)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/selftest/context.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index 0d26a07438..0e3244a1c5 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py | |||
@@ -91,6 +91,16 @@ class OESelftestTestContext(OETestContext): | |||
91 | # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow | 91 | # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow |
92 | subprocess.check_output("sed %s/conf/bblayers.conf -i -e 's#%s#%s#g'" % (newbuilddir, selftestdir, newselftestdir), cwd=newbuilddir, shell=True) | 92 | subprocess.check_output("sed %s/conf/bblayers.conf -i -e 's#%s#%s#g'" % (newbuilddir, selftestdir, newselftestdir), cwd=newbuilddir, shell=True) |
93 | 93 | ||
94 | # Relative paths in BBLAYERS only works when the new build dir share the same ascending node | ||
95 | if self.newbuilddir: | ||
96 | bblayers = subprocess.check_output("bitbake-getvar --value BBLAYERS | tail -1", cwd=builddir, shell=True, text=True) | ||
97 | if '..' in bblayers: | ||
98 | bblayers_abspath = [os.path.abspath(path) for path in bblayers.split()] | ||
99 | with open("%s/conf/bblayers.conf" % newbuilddir, "a") as f: | ||
100 | newbblayers = "# new bblayers to be used by selftest in the new build dir '%s'\n" % newbuilddir | ||
101 | newbblayers += 'BBLAYERS = "%s"\n' % ' '.join(bblayers_abspath) | ||
102 | f.write(newbblayers) | ||
103 | |||
94 | for e in os.environ: | 104 | for e in os.environ: |
95 | if builddir + "/" in os.environ[e]: | 105 | if builddir + "/" in os.environ[e]: |
96 | os.environ[e] = os.environ[e].replace(builddir + "/", newbuilddir + "/") | 106 | os.environ[e] = os.environ[e].replace(builddir + "/", newbuilddir + "/") |