]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
config: only use host release if we can detect one
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Mon, 22 May 2023 15:19:43 +0000 (17:19 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 1 Jun 2023 10:45:12 +0000 (12:45 +0200)
mkosi/config.py

index cc665b6d0ae094b9afabcdce805dffeeb93a8348..56182773b286ec1a6e0da5d9e0b7a8c951c44e5d 100644 (file)
@@ -188,7 +188,7 @@ def config_parse_compression(dest: str, value: Optional[str], namespace: argpars
         return Compression.zst if parse_boolean(value) else Compression.none
 
 
-def config_default_release(namespace: argparse.Namespace) -> Any:
+def config_default_release(namespace: argparse.Namespace) -> str:
     # If we encounter Release in [Match] and no distribution has been set yet, configure the default
     # distribution as well since the default release depends on the selected distribution.
     if "distribution" not in namespace:
@@ -198,7 +198,7 @@ def config_default_release(namespace: argparse.Namespace) -> Any:
 
     # If the configured distribution matches the host distribution, use the same release as the host.
     hd, hr = detect_distribution()
-    if d == hd:
+    if d == hd and hr is not None:
         return hr
 
     return {