From 2780d9c1a42ab34d0e542e6f1211aa1b8c9225dc Mon Sep 17 00:00:00 2001 From: Anton Farygin Date: Thu, 19 Sep 2024 19:09:23 +0300 Subject: [PATCH] depext: Add Altlinux family support using rpm for a package manager and apt-rpm (fork of the apt fron debian wuth RPM support) for the repository manager. --- master_changes.md | 1 + src/state/opamSysInteract.ml | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/master_changes.md b/master_changes.md index 1aa9069f5ee..c2c09561d0e 100644 --- a/master_changes.md +++ b/master_changes.md @@ -67,6 +67,7 @@ users) ## Opamfile ## External dependencies + * Add apt-rpm/ALTLinux family support for depext [#6207 @RiderALT] ## Format upgrade diff --git a/src/state/opamSysInteract.ml b/src/state/opamSysInteract.ml index dfbcdb2cb79..c8896d06494 100644 --- a/src/state/opamSysInteract.ml +++ b/src/state/opamSysInteract.ml @@ -115,6 +115,7 @@ end below pattern matching *) type families = | Alpine + | Altlinux | Arch | Centos | Cygwin @@ -174,6 +175,7 @@ let family ~env () = | Some family -> match family with | "alpine" | "wolfi" -> Alpine + | "altlinux" -> Altlinux | "amzn" | "centos" | "fedora" | "mageia" | "oraclelinux" | "ol" | "rhel" -> Centos | "archlinux" | "arch" -> Arch @@ -697,7 +699,7 @@ let packages_status ?(env=OpamVariable.Map.empty) config packages = compute_sets sys_installed ~sys_available | Arch -> compute_sets_for_arch ~pacman:"pacman" - | Centos -> + | Centos | Altlinux -> (* Output format: >crypto-policies >python3-pip-wheel @@ -1016,6 +1018,8 @@ let install_packages_commands_t ?(env=OpamVariable.Map.empty) config sys_package in match family ~env () with | Alpine -> [`AsAdmin "apk", "add"::yes ~no:["-i"] [] packages], None + | Altlinux -> + [`AsAdmin "apt-get", "install"::yes ["-qq"; "-yy"] packages], None | Arch -> [`AsAdmin "pacman", "-Su"::yes ["--noconfirm"] packages], None | Centos -> (* TODO: check if they all declare "rhel" as primary family *) @@ -1145,7 +1149,7 @@ let update ?(env=OpamVariable.Map.empty) config = | Arch -> Some (`AsAdmin "pacman", ["-Sy"]) | Centos -> Some (`AsAdmin (Lazy.force yum_cmd), ["makecache"]) | Cygwin -> None - | Debian -> Some (`AsAdmin "apt-get", ["update"]) + | Debian | Altlinux -> Some (`AsAdmin "apt-get", ["update"]) | Dummy test -> if test.install then None else Some (`AsUser "false", []) | Freebsd -> None