From 585cc6e52cdc812e6414cf0373e83af5f1788931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Behrmann?= Date: Mon, 2 Dec 2024 10:42:00 +0100 Subject: [PATCH 1/2] use Distribution.is_apt_distribution in detect_distribution --- mkosi/distributions/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi/distributions/__init__.py b/mkosi/distributions/__init__.py index e152e6dfb..4d7bb4b3c 100644 --- a/mkosi/distributions/__init__.py +++ b/mkosi/distributions/__init__.py @@ -188,7 +188,7 @@ def detect_distribution(root: Path = Path("/")) -> tuple[Optional[Distribution], if d is not None: break - if d in {Distribution.debian, Distribution.ubuntu, Distribution.kali} and version_codename: + if d and d.is_apt_distribution() and version_codename: version_id = version_codename return d, version_id From e8396a9f1a781884a83fcafb4b5efa81f36831bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Behrmann?= Date: Mon, 2 Dec 2024 10:42:29 +0100 Subject: [PATCH 2/2] debian: use pretty name in error message This way the error message works better for downstreams. --- mkosi/distributions/debian.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi/distributions/debian.py b/mkosi/distributions/debian.py index 7720f583f..b3daf4c92 100644 --- a/mkosi/distributions/debian.py +++ b/mkosi/distributions/debian.py @@ -240,7 +240,7 @@ def architecture(cls, arch: Architecture) -> str: }.get(arch) # fmt: skip if not a: - die(f"Architecture {arch} is not supported by Debian") + die(f"Architecture {arch} is not supported by {cls.pretty_name()}") return a