even more robust and conservative OCaml setup;
authorwenzelm
Fri, 22 Mar 2019 10:36:50 +0100
changeset 70130 a591de179931
parent 70126 ab8aad4aa76e
child 70131 a7a0115061ec
even more robust and conservative OCaml setup;
lib/Tools/ocaml_setup
lib/scripts/ocamlfind
--- a/lib/Tools/ocaml_setup	Thu Mar 21 19:46:26 2019 +0100
+++ b/lib/Tools/ocaml_setup	Fri Mar 22 10:36:50 2019 +0100
@@ -6,11 +6,14 @@
 
 set -e
 
-if [ -e "$ISABELLE_OPAM_ROOT/config" ]
+if [ -d "$ISABELLE_OPAM_ROOT/$ISABELLE_OCAML_VERSION/bin" ]
 then
-  isabelle_opam switch reinstall -y "$ISABELLE_OCAML_VERSION"
+  isabelle_opam switch -y "$ISABELLE_OCAML_VERSION"
+elif [ -e "$ISABELLE_OPAM_ROOT/config" ]
+then
+  isabelle_opam switch create -y "$ISABELLE_OCAML_VERSION"
 else
   isabelle_opam init -y --disable-sandboxing --no-setup --compiler="$ISABELLE_OCAML_VERSION"
 fi
 
-isabelle_opam install zarith -y
+isabelle_opam install -y zarith
--- a/lib/scripts/ocamlfind	Thu Mar 21 19:46:26 2019 +0100
+++ b/lib/scripts/ocamlfind	Fri Mar 22 10:36:50 2019 +0100
@@ -4,7 +4,7 @@
 #
 # Invoke ocamlfind via "opam".
 
-if [ -e "$ISABELLE_OPAM_ROOT/config" ]
+if [ -d "$ISABELLE_OPAM_ROOT/$ISABELLE_OCAML_VERSION/bin" ]
 then
   isabelle_opam config exec --switch "$ISABELLE_OCAML_VERSION" -- ocamlfind "$@"
 else