Skip to content

Commit

Permalink
Merge pull request #6207 from RiderALT/opam-altlinux-support
Browse files Browse the repository at this point in the history
depext: Add Altlinux family support
  • Loading branch information
kit-ty-kate authored Oct 29, 2024
2 parents 240fb1f + 2780d9c commit f898d21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ users)
## Opamfile

## External dependencies
* Add apt-rpm/ALTLinux family support for depext [#6207 @RiderALT]

## Format upgrade

Expand Down
8 changes: 6 additions & 2 deletions src/state/opamSysInteract.ml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ end
below pattern matching *)
type families =
| Alpine
| Altlinux
| Arch
| Centos
| Cygwin
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 *)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f898d21

Please sign in to comment.