Skip to content

Commit

Permalink
depexts: Disable the detection of available packages on RHEL-based di…
Browse files Browse the repository at this point in the history
…stributions
  • Loading branch information
kit-ty-kate committed Aug 8, 2021
1 parent 1b43c71 commit 809551a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
4 changes: 4 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ users)
## External dependencies
* 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]
* 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
28 changes: 4 additions & 24 deletions src/state/opamSysInteract.ml
Original file line number Diff line number Diff line change
Expand Up @@ -286,30 +286,9 @@ 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
*)
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
in
compute_sets sys_installed ~sys_available
let lines = run_query_command "rpm" ["-qa"; "--qf"; "%{NAME}\\n"] in
let sys_installed = OpamSysPkg.Set.of_list (List.map OpamSysPkg.of_string lines) in
compute_sets sys_installed
| Debian ->
let sys_available, sys_provides, _ =
let provides_sep = Re.(compile @@ str ", ") in
Expand Down Expand Up @@ -582,6 +561,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 809551a

Please sign in to comment.