if namespace.distribution == hd and hr is not None:
return hr
- return {
- Distribution.fedora: "38",
- Distribution.centos: "9",
- Distribution.rocky: "9",
- Distribution.alma: "9",
- Distribution.mageia: "cauldron",
- Distribution.debian: "testing",
- Distribution.ubuntu: "lunar",
- Distribution.opensuse: "tumbleweed",
- Distribution.openmandriva: "cooker",
- Distribution.gentoo: "17.1",
- }.get(namespace.distribution, "rolling")
+ return cast(str, namespace.distribution.default_release())
def config_default_mirror(namespace: argparse.Namespace) -> Optional[str]:
def package_type(cls) -> PackageType:
raise NotImplementedError()
+ @classmethod
+ def default_release(cls) -> str:
+ raise NotImplementedError()
+
class Distribution(StrEnum):
fedora = enum.auto()
def package_type(self) -> PackageType:
return self.installer().package_type()
+ def default_release(self) -> str:
+ return self.installer().default_release()
+
def installer(self) -> Type[DistributionInstaller]:
try:
mod = importlib.import_module(f"mkosi.distributions.{self}")
def package_type(cls) -> PackageType:
return PackageType.pkg
+ @classmethod
+ def default_release(cls) -> str:
+ return "rolling"
+
@classmethod
def setup(cls, state: MkosiState) -> None:
setup_pacman(state)
def package_type(cls) -> PackageType:
return PackageType.rpm
+ @classmethod
+ def default_release(cls) -> str:
+ return "9"
+
@classmethod
def setup(cls, state: MkosiState) -> None:
release = int(state.config.release)
def package_type(cls) -> PackageType:
return PackageType.deb
+ @classmethod
+ def default_release(cls) -> str:
+ return "testing"
+
@staticmethod
def repositories(state: MkosiState, local: bool = True) -> list[str]:
assert state.config.mirror
def package_type(cls) -> PackageType:
return PackageType.rpm
+ @classmethod
+ def default_release(cls) -> str:
+ return "38"
+
@classmethod
def setup(cls, state: MkosiState) -> None:
# See: https://fedoraproject.org/security/
def package_type(cls) -> PackageType:
return PackageType.ebuild
+ @classmethod
+ def default_release(cls) -> str:
+ return "17.1"
+
@classmethod
def setup(cls, state: MkosiState) -> None:
pass
def package_type(cls) -> PackageType:
return PackageType.rpm
+ @classmethod
+ def default_release(cls) -> str:
+ return "cauldron"
+
@classmethod
def setup(cls, state: MkosiState) -> None:
release = state.config.release.strip("'")
def package_type(cls) -> PackageType:
return PackageType.rpm
+ @classmethod
+ def default_release(cls) -> str:
+ return "cooker"
+
@classmethod
def setup(cls, state: MkosiState) -> None:
release = state.config.release.strip("'")
def package_type(cls) -> PackageType:
return PackageType.rpm
+ @classmethod
+ def default_release(cls) -> str:
+ return "tumbleweed"
+
@classmethod
def setup(cls, state: MkosiState) -> None:
release = state.config.release
class UbuntuInstaller(DebianInstaller):
+ @classmethod
+ def default_release(cls) -> str:
+ return "lunar"
+
@staticmethod
def repositories(state: MkosiState, local: bool = True) -> list[str]:
if state.config.local_mirror and local: