]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
fix missing exist_ok for debian /usr
authorCornelius Hoffmann <coding@hoffmn.de>
Wed, 24 May 2023 22:24:41 +0000 (00:24 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 25 May 2023 09:16:20 +0000 (11:16 +0200)
This would prevent having /usr in a skeleton tree

mkosi/distributions/debian.py

index 40a053c29121a9033f4763ff98473a3b944b00d8..eedabec69da9fbb0d1a6f81e89f7d0890d0c5716 100644 (file)
@@ -70,10 +70,10 @@ class DebianInstaller(DistributionInstaller):
             "x32"         : ["lib32", "lib64", "libx32"],
         }.get(DEBIAN_ARCHITECTURES[state.config.architecture], [])
 
-        state.root.joinpath("usr").mkdir(mode=0o755)
+        state.root.joinpath("usr").mkdir(mode=0o755, exist_ok=True)
         for d in subdirs:
             state.root.joinpath(d).symlink_to(f"usr/{d}")
-            state.root.joinpath(f"usr/{d}").mkdir(mode=0o755)
+            state.root.joinpath(f"usr/{d}").mkdir(mode=0o755, exist_ok=True)
 
         # Next, we invoke apt-get install to download all the essential packages. With DPkg::Pre-Install-Pkgs,
         # we specify a shell command that will receive the list of packages that will be installed on stdin.