summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Congal <yoann.congal@smile.fr>2024-09-10 22:47:35 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-09-12 16:15:09 +0100
commit61186bc98a556aa25ef5ed8e419c6a3e60dbfbe5 (patch)
tree75d931b9c72d620d89aff5b87d4ae096bc01b75e
parent40052a34c66a6b93fbfc57e2aa705f82bb250ad7 (diff)
downloadpoky-61186bc98a556aa25ef5ed8e419c6a3e60dbfbe5.tar.gz
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>
-rw-r--r--meta/lib/oeqa/selftest/context.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py
index 99186175e5..acc3b073bd 100644
--- a/meta/lib/oeqa/selftest/context.py
+++ b/meta/lib/oeqa/selftest/context.py
@@ -117,8 +117,11 @@ class OESelftestTestContext(OETestContext):
117 newbblayers += 'BBLAYERS = "%s"\n' % ' '.join(bblayers_abspath) 117 newbblayers += 'BBLAYERS = "%s"\n' % ' '.join(bblayers_abspath)
118 f.write(newbblayers) 118 f.write(newbblayers)
119 119
120 # Rewrite builddir paths seen in environment variables
120 for e in os.environ: 121 for e in os.environ:
121 if builddir + "/" in os.environ[e]: 122 # Rewrite paths that absolutely point inside builddir
123 # (e.g $builddir/conf/ would be rewritten but not $builddir/../bitbake/)
124 if builddir + "/" in os.environ[e] and builddir + "/" in os.path.abspath(os.environ[e]):
122 os.environ[e] = os.environ[e].replace(builddir + "/", newbuilddir + "/") 125 os.environ[e] = os.environ[e].replace(builddir + "/", newbuilddir + "/")
123 if os.environ[e].endswith(builddir): 126 if os.environ[e].endswith(builddir):
124 os.environ[e] = os.environ[e].replace(builddir, newbuilddir) 127 os.environ[e] = os.environ[e].replace(builddir, newbuilddir)