mirror of
https://git.yoctoproject.org/poky
synced 2026-02-02 14:58:43 +01:00
oeqa/selftest: Only rewrite envvars paths that absolutely point to builddir
When building the new selftest builddir, paths in environment variables are rewritten to point to the new buildir, but users can have environment variables that point outside of the build dir using relative paths from builddir. We must not rewrite those. Check this by verifying that the absolute path still contains the builddir. Fixes [YOCTO #15241] (From OE-Core rev: c5e70500caffcd0518899cc6eba23a38bc3be108) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
40052a34c6
commit
61186bc98a
@@ -117,8 +117,11 @@ class OESelftestTestContext(OETestContext):
|
||||
newbblayers += 'BBLAYERS = "%s"\n' % ' '.join(bblayers_abspath)
|
||||
f.write(newbblayers)
|
||||
|
||||
# Rewrite builddir paths seen in environment variables
|
||||
for e in os.environ:
|
||||
if builddir + "/" in os.environ[e]:
|
||||
# Rewrite paths that absolutely point inside builddir
|
||||
# (e.g $builddir/conf/ would be rewritten but not $builddir/../bitbake/)
|
||||
if builddir + "/" in os.environ[e] and builddir + "/" in os.path.abspath(os.environ[e]):
|
||||
os.environ[e] = os.environ[e].replace(builddir + "/", newbuilddir + "/")
|
||||
if os.environ[e].endswith(builddir):
|
||||
os.environ[e] = os.environ[e].replace(builddir, newbuilddir)
|
||||
|
||||
Reference in New Issue
Block a user