Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 43 lines (39 sloc) 1.021 kb
fccc685 Initial open-source release
MLstate authored
1 (* this is the post infos *)
2
3 let git_version_counter =
4 opalang_git_version
5
6 let version_id = Printf.sprintf "%d-(%s)"
7 git_version_counter
8 opalang_git_sha
607c286 [feature] compiler option: --minimal-version for Makefile
Mathieu Barbin authored
9
10 let assert_minimal_version s =
11 let check_int version =
12 if version > 27000
13 then
14 (*
15 At the time we write this code, the number of build
16 has been reset to 0.
17 *)
18 true
19 else
20 version <= opalang_git_version
21 in
22 try
23 let version = int_of_string s in
24 Some (check_int version)
25 with
26 | Failure "int_of_string" ->
27 (*
28 The given string may be: v45.
29 These tests are painful, but we are outside of libbase's scope there :)
30 *)
31 if String.length s > 0 && s.[0] = 'v'
32 then
33 let sub = String.sub s 1 (pred (String.length s)) in
34 try Some (check_int (int_of_string sub))
35 with Failure _ -> None
36 else
37 (* or S3.5 *)
38 if String.length s > 0 && s.[0] = 'S'
39 then
40 Some (s <= opa_version_name)
41 else
42 None
Something went wrong with that request. Please try again.