]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Skip normalize_mtime() if the directory does not exist
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 14 Jan 2024 19:50:08 +0000 (20:50 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 14 Jan 2024 20:52:15 +0000 (21:52 +0100)
mkosi/__init__.py

index 53aa03489f0f9fb4f4af9a896d6c24fb53df2775..70374e600ce3b7fec81934ec70ad9c3dbdf423d4 100644 (file)
@@ -2720,6 +2720,9 @@ def normalize_mtime(root: Path, mtime: Optional[int], directory: Optional[Path]
 
     directory = directory or Path("")
 
+    if not (root / directory).exists():
+        return
+
     with complete_step(f"Normalizing modification times of /{directory}"):
         os.utime(root / directory, (mtime, mtime), follow_symlinks=False)
         for p in (root / directory).rglob("*"):