File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ echo -en "travis_fold:start:prepare.ci\r"
5
5
default_user=ocaml
6
6
default_branch=master
7
7
default_hub_user=ocaml
8
- default_opam_version=1.2 .0
8
+ default_opam_version=2.0 .0
9
9
10
10
fork_user=${FORK_USER:- $default_user }
11
11
fork_branch=${FORK_BRANCH:- $default_branch }
Original file line number Diff line number Diff line change @@ -61,7 +61,12 @@ let revdep_run = list (getenv_default "REVDEPS" "")
61
61
let opam_lint = fuzzy_bool_of_string (getenv_default " OPAM_LINT" " true" )
62
62
63
63
(* opam version *)
64
- let opam_version = getenv_default " OPAM_VERSION" " 2.0.0"
64
+ let opam_version =
65
+ let raw = ?|> " opam --version" in
66
+ match if String. length raw < = 1 then '?' else raw.[0 ] with
67
+ | '2' -> `V2
68
+ | '1' -> `V1
69
+ | _ -> failwith (raw ^ " : invalid opam version" )
65
70
66
71
(* other variables *)
67
72
let extra_deps = list (getenv_default " EXTRA_DEPS" " " )
@@ -252,8 +257,8 @@ with_fold "Prepare" (fun () ->
252
257
in
253
258
254
259
(if opam_lint then match opam_version with
255
- | "2.0.0" -> ?|~ " opam lint %s --warn=-21-32-48" opam
256
- | _ -> ?|~ " opam lint %s" opam);
260
+ | `V2 -> ?|~ " opam lint %s --warn=-21-32-48" opam
261
+ | _ -> ?|~ " opam lint %s" opam);
257
262
let pins = lint_pins pkg pins in
258
263
List. iter pin pins;
259
264
?| " eval $(opam config env)" ;
You can’t perform that action at this time.
0 commit comments