From 2342a74bd06434fe2635e9aefddcf0b55c91209c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 10 Nov 2023 13:18:05 +0100 Subject: [PATCH] Drop compression suffix for directory output The automatic logic would produce a name like "initrd_6.6.0.zst", even though there is no compression. --- mkosi/config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mkosi/config.py b/mkosi/config.py index 9dde626e2..2da446fb2 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -116,6 +116,11 @@ def extension(self) -> str: OutputFormat.uki: ".efi", }.get(self, "") + def use_outer_compression(self) -> bool: + return self in (OutputFormat.tar, + OutputFormat.cpio, + OutputFormat.disk) + class ManifestFormat(StrEnum): json = enum.auto() # the standard manifest in json format @@ -972,7 +977,7 @@ def output_with_format(self) -> str: def output_with_compression(self) -> str: output = self.output_with_format - if self.compress_output and self.output_format not in (OutputFormat.uki, OutputFormat.esp): + if self.compress_output and self.output_format.use_outer_compression(): output += f".{self.compress_output}" return output