Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tag: 0.7.6
Fetching contributors…

Cannot retrieve contributors at this time

59 lines (48 sloc) 2.101 kB
(***********************************************************************)
(* *)
(* Copyright 2012 OCamlPro *)
(* Copyright 2012 INRIA *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Public License version 3.0. *)
(* *)
(* OPAM is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU General Public License for more details. *)
(* *)
(***********************************************************************)
open OpamMisc.OP
type relop = [`Eq|`Geq|`Gt|`Leq|`Lt]
module Compiler = struct
include OpamMisc.Base
type constr = (relop * t) OpamFormula.formula
let current () =
match OpamSystem.ocaml_version () with
| None -> None
| Some o -> Some (of_string o)
let compare v1 r v2 =
let v1 = to_string v1 in
let v2 = to_string v2 in
match r with
| `Eq -> Debian.Version.equal v1 v2
| `Geq -> Debian.Version.compare v1 v2 >= 0
| `Gt -> Debian.Version.compare v1 v2 > 0
| `Leq -> Debian.Version.compare v1 v2 <= 0
| `Lt -> Debian.Version.compare v1 v2 < 0
let list t =
if OpamFilename.exists_dir t then (
let files = OpamFilename.list_files t in
let files = List.filter (fun f -> OpamFilename.check_suffix f ".comp") files in
let l =
List.map
(OpamFilename.chop_extension
|> OpamFilename.basename
|> OpamFilename.Base.to_string
|> of_string)
files in
Set.of_list l
) else
Set.empty
end
module OPAM = OpamMisc.Base
Jump to Line
Something went wrong with that request. Please try again.