Skip to content
This repository
tree: 069a44a67b
Fetching contributors…

Cannot retrieve contributors at this time

file 42 lines (39 sloc) 1.021 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
(* this is the post infos *)

let git_version_counter =
  opalang_git_version

let version_id = Printf.sprintf "%d-(%s)"
  git_version_counter
  opalang_git_sha

let assert_minimal_version s =
  let check_int version =
    if version > 27000
    then
      (*
        At the time we write this code, the number of build
        has been reset to 0.
      *)
      true
    else
      version <= opalang_git_version
  in
  try
    let version = int_of_string s in
    Some (check_int version)
  with
  | Failure "int_of_string" ->
      (*
        The given string may be: v45.
        These tests are painful, but we are outside of libbase's scope there :)
      *)
      if String.length s > 0 && s.[0] = 'v'
      then
        let sub = String.sub s 1 (pred (String.length s)) in
        try Some (check_int (int_of_string sub))
        with Failure _ -> None
      else
        (* or S3.5 *)
        if String.length s > 0 && s.[0] = 'S'
        then
          Some (s <= opa_version_name)
        else
          None
Something went wrong with that request. Please try again.