From: Daan De Meyer Date: Thu, 10 Oct 2024 12:12:55 +0000 (+0200) Subject: Check if tools tree exists before statting it in cache_manifest() X-Git-Tag: v25~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2469e6dc42d9c09c9edf589858658fcc63fde978;p=thirdparty%2Fmkosi.git Check if tools tree exists before statting it in cache_manifest() The tools tree might have been removed because it's cache was out of date so let's make sure we check it exists in cache_manifest(). --- diff --git a/mkosi/config.py b/mkosi/config.py index d8f491dc2..02989006b 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -1871,7 +1871,11 @@ class Config: base64.b64encode(script.read_bytes()).decode() for script in self.prepare_scripts ), # Statting the root directory of the tools tree isn't fool proof but should be good enough. - "tools_tree": [self.tools_tree, self.tools_tree.stat().st_mtime_ns] if self.tools_tree else [], + "tools_tree": ( + [self.tools_tree, self.tools_tree.stat().st_mtime_ns] + if self.tools_tree and self.tools_tree.exists() + else [] + ), } def to_dict(self) -> dict[str, Any]: