Skip to content

Commit

Permalink
Allow installing absent package on "opam reinstall"
Browse files Browse the repository at this point in the history
(after a confirmation)
Closes ocaml#1082
  • Loading branch information
AltGr committed Apr 15, 2014
1 parent de39c28 commit d748bf6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/client/opamClient.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1102,10 +1102,14 @@ module API = struct
let reinstall, not_installed =
get_installed_atoms t atoms in
if not_installed <> [] then
OpamGlobals.error_and_exit "%s %s not installed.\n"
(OpamMisc.pretty_list
(List.map OpamFormula.short_string_of_atom not_installed))
(match not_installed with [_] -> "is" | _ -> "are");
(OpamGlobals.warning "%s %s not installed."
(OpamMisc.pretty_list
(List.map OpamFormula.short_string_of_atom not_installed))
(match not_installed with [_] -> "is" | _ -> "are");
if OpamState.confirm "Install ?" then
install_t atoms None false t)
else

let reinstall = OpamPackage.Set.of_list reinstall in
let universe = OpamState.universe t Depends in
let depends = (* Do not cast to a set, we need to keep the order *)
Expand Down

0 comments on commit d748bf6

Please # to comment.