]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Log before going into debug shell
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 11 Jan 2024 07:55:13 +0000 (08:55 +0100)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 11 Jan 2024 09:10:35 +0000 (10:10 +0100)
Fixes #2269

mkosi/run.py

index 85c8a8cb1f2318ff811ab982337e69d8367b8959..c72ed4eca9302156aa092cc376fe58e59eac3739 100644 (file)
@@ -313,6 +313,8 @@ def run(
     except FileNotFoundError as e:
         die(f"{e.filename} not found.")
     except subprocess.CalledProcessError as e:
+        if log:
+            log_process_failure(cmdline, e.returncode)
         if ARG_DEBUG_SHELL.get():
             subprocess.run(
                 [*sandbox, "sh"],
@@ -325,8 +327,6 @@ def run(
                 cwd=cwd,
                 preexec_fn=preexec,
             )
-        if log:
-            log_process_failure(cmdline, e.returncode)
         # Remove the sandboxing stuff from the command line to show a more readable error to users.
         e.cmd = cmdline
         raise