Skip to content

Commit

Permalink
Merge pull request #4791 from kit-ty-kate/fix-2
Browse files Browse the repository at this point in the history
depexts: Disable the detection of available packages on RHEL-based distributions
  • Loading branch information
rjbou committed Sep 13, 2021
2 parents 65ea1c3 + c76a512 commit 78093ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
4 changes: 4 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ users)
* Set DEBIAN_FRONTEND=noninteractive for unsafe-yes confirmation level [#4735 @dra27 - partially fix #4731] [2.1.0~rc2 #4739]
* Fix depext alpine tagged repositories handling [#4763 @rjbou] [2.1.0~rc2 #4758]
* Homebrew: Add support for casks and full-names [#4801 @kit-ty-kate]
* Disable the detection of available packages on RHEL-based distributions.
This fixes an issue on RHEL-based distributions where yum list used to detect available
and installed packages would wait for user input without showing any output and/or fail
in some cases [#4791 @kit-ty-kate - fixes #4790]

## Format upgrade
* Fix format upgrade when there is missing local switches in the config file [#4763 @rjbou - fix #4713] [2.1.0~rc2 #4715]
Expand Down
31 changes: 9 additions & 22 deletions src/state/opamSysInteract.ml
Original file line number Diff line number Diff line change
Expand Up @@ -286,30 +286,16 @@ let packages_status packages =
in
compute_sets sys_installed ~sys_available
| Centos ->
(* XXX /!\ only checked on centos XXX *)
let lines = run_query_command "yum" ["-q"; "-C"; "list"] in
(* -C to retrieve from cache, no update but still quite long, 1,5 sec *)
(* Return a list of installed packages then available ones:
>Installed Packages
>foo.arch version repo
>Available Packages
>bar.arch version repo
(* Output format:
>crypto-policies
>python3-pip-wheel
*)
let sys_installed, sys_available, _ =
List.fold_left (fun (inst,avail,part) -> function
(* beware of locales!! *)
| "Installed Packages" -> inst, avail, `installed
| "Available Packages" -> inst, avail, `available
| l ->
(match part, OpamStd.String.split l '.' with
| `installed, pkg::_ ->
pkg +++ inst, avail, part
| `available, pkg::_ ->
inst, pkg +++ avail, part
| _ -> (* shouldn't happen *) inst, avail, part))
OpamSysPkg.Set.(empty, empty, `preamble) lines
let sys_installed =
run_query_command "rpm" ["-qa"; "--qf"; "%{NAME}\\n"]
|> List.map OpamSysPkg.of_string
|> OpamSysPkg.Set.of_list
in
compute_sets sys_installed ~sys_available
compute_sets sys_installed
| Debian ->
let sys_available, sys_provides, _ =
let provides_sep = Re.(compile @@ str ", ") in
Expand Down Expand Up @@ -589,6 +575,7 @@ let install_packages_commands_t sys_packages =
| Arch -> ["pacman", "-Su"::yes ["--noconfirm"] packages], None
| Centos ->
(* TODO: check if they all declare "rhel" as primary family *)
(* Kate's answer: no they don't :( (e.g. Fedora, Oraclelinux define Nothing and "fedora" respectively) *)
(* When opam-packages specify the epel-release package, usually it
means that other dependencies require the EPEL repository to be
already setup when yum-install is called. Cf. opam-depext/#70,#76. *)
Expand Down

0 comments on commit 78093ea

Please sign in to comment.