]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Only try to apply ACL to image output if it's a directory
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 9 May 2023 09:56:35 +0000 (11:56 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Tue, 9 May 2023 10:19:08 +0000 (12:19 +0200)
mkosi/__init__.py

index dffbc3702c265ec9893d924dd3920f7e107c8e31..e0089a5aa34a8347900893c370040dac9c694904 100644 (file)
@@ -1802,9 +1802,13 @@ def acl_toggle_build(state: MkosiState) -> Iterator[None]:
             if p and p.is_dir():
                 stack.enter_context(acl_maybe_toggle(state.config, p, state.uid, always=False))
 
-        for p in (state.config.cache_dir, state.config.output_dir / state.config.output):
-            if p:
-                stack.enter_context(acl_maybe_toggle(state.config, p, state.uid, always=True))
+        if state.config.cache_dir:
+            stack.enter_context(acl_maybe_toggle(state.config, state.config.cache_dir, state.uid, always=True))
+
+        if state.config.output_format == OutputFormat.directory:
+            stack.enter_context(acl_maybe_toggle(state.config,
+                                                 state.config.output_dir / state.config.output,
+                                                 state.uid, always=True))
 
         yield