From: Daan De Meyer Date: Sun, 14 Jan 2024 19:50:08 +0000 (+0100) Subject: Skip normalize_mtime() if the directory does not exist X-Git-Tag: v20.2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9b3cd576dda05949e258b93a502896ccabe6dfa;p=thirdparty%2Fmkosi.git Skip normalize_mtime() if the directory does not exist --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 53aa03489..70374e600 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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("*"):