Skip to content

Commit

Permalink
Simplify OpamClient.compute_upgrade_t
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Jan 23, 2025
1 parent 8cf4540 commit b578106
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/client/opamClient.ml
Original file line number Diff line number Diff line change
Expand Up @@ -113,27 +113,16 @@ let compute_upgrade_t
| Some nv -> not (OpamPackage.Set.mem nv (Lazy.force t.available_packages)))
atoms
in
let criteria = if to_install = [] && all then `Upgrade else `Default in
if all then
names,
OpamSolution.resolve t Upgrade
~requested:packages
~reinstall:(Lazy.force t.reinstall)
(OpamSolver.request
~install:to_install
~upgrade:to_upgrade
~deprequest:(OpamFormula.to_atom_formula formula)
~all:[]
~criteria ())
else
names,
OpamSolution.resolve t Upgrade
~requested:packages
?reinstall:(if all then Some (Lazy.force t.reinstall) else None)
(OpamSolver.request
~install:to_install
~upgrade:to_upgrade
~deprequest:(OpamFormula.to_atom_formula formula)
~criteria
?all:(if all then Some [] else None)
~criteria:(if to_install = [] && all then `Upgrade else `Default)
())

let print_requested requested formula =
Expand Down

0 comments on commit b578106

Please sign in to comment.