Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
Co-authored-by: Raja Boujbel <raja.boujbel@ocamlpro.com>
  • Loading branch information
kit-ty-kate and rjbou committed May 3, 2024
1 parent 3781f29 commit 36cd052
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/client/opamTreeCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -404,23 +404,25 @@ let dry_install tog st universe install =

let run st tog ?no_constraint mode filter atoms =
let open OpamPackage.Set.Op in
let select, missing, requested =
List.fold_left (fun (select, missing, requested) atom ->
let select, missing =
List.fold_left (fun (select, missing) atom ->
let installed =
OpamPackage.Set.filter (OpamFormula.check atom) st.installed
in
if OpamPackage.Set.is_empty installed then
let missing_pkgs = OpamPackage.Set.filter (OpamFormula.check atom) st.packages in
if OpamPackage.Set.is_empty missing_pkgs then
assert false;
(select, atom :: missing, requested ++ missing_pkgs)
(select, atom :: missing)
else
let select = installed ++ select in
(select, missing, requested ++ select))
(OpamPackage.Set.empty, [], OpamPackage.Set.empty) atoms
(installed ++ select, missing))
(OpamPackage.Set.empty, []) atoms
in
let st, universe =
let universe = get_universe tog requested st in
let universe =
let requested =
OpamFormula.packages_of_atoms
(if missing = [] then st.installed else st.packages) atoms
in
get_universe tog requested st
in
match mode, filter, missing with
| Deps, _, [] -> st, universe
| Deps, Roots_from, _::_ ->
Expand Down

0 comments on commit 36cd052

Please sign in to comment.