]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Only mount cache overlay if base trees are specified and Overlay= is not enabled 2236/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 3 Jan 2024 13:46:16 +0000 (14:46 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 3 Jan 2024 15:24:38 +0000 (16:24 +0100)
The setup() method of some distributions creates files in the root
directory which means that checking if the root directory is empty
doesn't work. Instead, let's check if any base trees were specified
explicitly.

mkosi/__init__.py

index 4d1a69bfcb8e73a26693037c6072e8f273e31e36..f3bae373c04cbd57c38cbf994598b72dc73f9411 100644 (file)
@@ -312,7 +312,7 @@ def configure_autologin(context: Context) -> None:
 
 @contextlib.contextmanager
 def mount_cache_overlay(context: Context) -> Iterator[None]:
-    if not context.config.incremental or not any(context.root.iterdir()):
+    if not context.config.incremental or not context.config.base_trees or context.config.overlay:
         yield
         return