From: Franck Bui Date: Mon, 13 Feb 2023 16:10:36 +0000 (+0100) Subject: opensuse: implements remove_packages() X-Git-Tag: v15~322^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89e56a89116e6356da65d2debbe96635e688b4f6;p=thirdparty%2Fmkosi.git opensuse: implements remove_packages() --- diff --git a/mkosi/distributions/opensuse.py b/mkosi/distributions/opensuse.py index 817a9df8c..4e53aed5a 100644 --- a/mkosi/distributions/opensuse.py +++ b/mkosi/distributions/opensuse.py @@ -23,6 +23,10 @@ class OpensuseInstaller(DistributionInstaller): def install(cls, state: MkosiState) -> None: return install_opensuse(state) + @classmethod + def remove_packages(cls, state: MkosiState, packages: list[str]) -> None: + zypper_remove(state, packages) + @staticmethod def initrd_path(kver: str) -> Path: return Path("boot") / f"initrd-{kver}" @@ -60,6 +64,11 @@ def zypper_install(state: MkosiState, packages: Iterable[str]) -> None: run_with_apivfs(state, cmdline) +def zypper_remove(state: MkosiState, packages: Iterable[str]) -> None: + cmdline = ["zypper", "--root", state.root, "remove", "-y", "--clean-deps", *packages] + run_with_apivfs(state, cmdline) + + @complete_step("Installing openSUSE…") def install_opensuse(state: MkosiState) -> None: release = state.config.release.strip('"')