Commit 88c57260 authored by Louis Gesbert's avatar Louis Gesbert
Browse files

Fix removed package not being properly registered

parent 290261ca
......@@ -213,11 +213,12 @@ let custom_install =
let cmd =
Arg.(non_empty & pos_right 0 string [] &
info [] ~docv:"-- COMMAND [ARG]"
info [] ~docv:"-- COMMAND [ARG]" ~doc:
"Command to run in the current directory that is expected to \
install the files for $(i,PACKAGE) to the current opam switch \
prefix. Variable expansions like $(b,%{prefix}%), $(b,%{name}%), \
$(b,%{version}%) and $(b,%{package}) are expanded as per the \
$(i,install:) package definition field.")
let custom_install
global_options build_options no_recompilations package cmd =
......@@ -252,15 +253,21 @@ let custom_install =
{st with
opams = OpamPackage.Map.add nv opam st.opams;
packages = OpamPackage.Set.add nv st.packages;
available_packages = lazy (OpamPackage.Set.add nv (Lazy.force st.available_packages));
available_packages =
lazy (OpamPackage.Set.add nv (Lazy.force st.available_packages));
let simple_install () =
(* when no recompilations are needed *)
if is_installed then @@
OpamAction.remove_package st ~force:true @@
OpamPackage.package_of_name st.installed;
let st =
if is_installed then
let old_pkg = OpamPackage.package_of_name st.installed in
let st = OpamSwitchAction.remove_from_installed st old_pkg in @@
OpamAction.remove_package st ~force:true old_pkg;
else st
match @@
OpamAction.install_package st ~build_dir nv
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment