diff options
-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 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 + "/") |