]> code.ossystems Code Review - openembedded-core.git/commitdiff
selftest/signing: Ensure build path relocation is safe
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 7 Sep 2020 15:29:52 +0000 (16:29 +0100)
committerSteve Sakoman <steve@sakoman.com>
Mon, 14 Sep 2020 14:26:37 +0000 (04:26 -1000)
Similarly to 04ee0e8b95cd8ed890374e0007f976684206b630, ensure only full
build paths are replaced in the environment to avoid breaking buildtools.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit fcd0a9683af1a9155eabbd9056e3b46d4a931b2e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/lib/oeqa/selftest/cases/signing.py

index 202d54994b6fd1346890f02c9d6bfe1f619f1fa5..a28c7eb19a1545d12fb758a7067b2f1db96a1870 100644 (file)
@@ -44,7 +44,9 @@ class Signing(OESelftestTestCase):
         origenv = os.environ.copy()
 
         for e in os.environ:
-            if builddir in os.environ[e]:
+            if builddir + "/" in 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)
 
         os.chdir(newbuilddir)