]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Add fallback paths to PATH in run_workspace_command() 1369/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 3 Mar 2023 20:10:01 +0000 (21:10 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 5 Mar 2023 07:54:31 +0000 (08:54 +0100)
Some distros don't configure the appropriate default PATH for their
shell when executed non-interactively, so let's add some fallback
entries ourselves to make sure we can always find the executables we
need.

mkosi/run.py

index e594771546eeebf3fca92156fef0dcab595f3fff..ca7e387137e9f6c5c52c986fab5ab15664dc5ce3 100644 (file)
@@ -325,7 +325,7 @@ def run_workspace_command(
         PATH="",
     ) | env | state.environment
 
-    template = "chmod 1777 /tmp /var/tmp /dev/shm && exec {} || exit $?"
+    template = "chmod 1777 /tmp /var/tmp /dev/shm && PATH=$PATH:/usr/bin:/usr/sbin exec {} || exit $?"
 
     try:
         return run([*cmdline, template.format(shlex.join(str(s) for s in cmd))],