]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Use a subdirectory of the workspace as TMPDIR
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 24 Jan 2024 08:58:26 +0000 (09:58 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 24 Jan 2024 08:59:58 +0000 (09:59 +0100)
Let's properly distinguish temporary files from workspace files by
putting the temporary files in a subdirectory of the workspace.

mkosi/__init__.py

index 6c64610b7c3f5af7a6fb02ae5e63ce222f0de862..21f09a86ebbebd3daa09a9970db2a84c7ec3d968 100644 (file)
@@ -2844,8 +2844,9 @@ def setup_workspace(args: Args, config: Config) -> Iterator[Path]:
             options=["--bind", config.workspace_dir_or_default(), config.workspace_dir_or_default()],
         )
         stack.callback(lambda: rmtree(workspace, sandbox=sandbox))
+        (workspace / "tmp").mkdir(mode=0o1777)
 
-        with scopedenv({"TMPDIR" : os.fspath(workspace)}):
+        with scopedenv({"TMPDIR" : os.fspath(workspace / "tmp")}):
             try:
                 yield Path(workspace)
             except BaseException: