diff mbox series

[whinlatter,19/19] devtool: deploy: Reset PATH after strip_execs

Message ID ea633ee08638624e18ec14ca69ace3a72b498a31.1770968514.git.yoann.congal@smile.fr
State RFC
Delegated to: Yoann Congal
Headers show
Series [whinlatter,01/19] linux-yocto/6.12: update to v6.12.69 | expand

Commit Message

Yoann Congal Feb. 13, 2026, 8:08 a.m. UTC
From: Paul Barker <paul@pbarker.dev>

We need to modify os.environ so that strip_execs() finds the correct
binaries to run. We shouldn't leave this modification in place for the
rest of the program execution though.

Signed-off-by: Paul Barker <paul@pbarker.dev>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c77f0b29b1983e143ffc7ab4bb869514d7afd601)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 scripts/lib/devtool/deploy.py | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/scripts/lib/devtool/deploy.py b/scripts/lib/devtool/deploy.py
index 2bf693d165a..270e9104b25 100644
--- a/scripts/lib/devtool/deploy.py
+++ b/scripts/lib/devtool/deploy.py
@@ -188,8 +188,11 @@  def deploy_no_d(srcdir, workdir, path, strip_cmd, libdir, base_libdir, max_proce
         if os.path.isdir(recipe_outdir):
             exec_fakeroot_no_d(fakerootcmd, fakerootenv, path, "rm -rf %s" % recipe_outdir, shell=True)
         exec_fakeroot_no_d(fakerootcmd, fakerootenv, path, "cp -af %s %s" % (os.path.join(srcdir, '.'), recipe_outdir), shell=True)
+
+        oldpath = os.environ['PATH']
         os.environ['PATH'] = ':'.join([os.environ['PATH'], path or ''])
         oe.package.strip_execs(args.recipename, recipe_outdir, strip_cmd, libdir, base_libdir, max_process)
+        os.environ['PATH'] = oldpath
 
     filelist = []
     inodes = set({})