2018-04-24 12:22:41 +00:00
|
|
|
open Stdune
|
2018-03-02 18:44:03 +00:00
|
|
|
|
|
|
|
module Name = struct
|
2018-05-24 13:51:12 +00:00
|
|
|
include Interned.Make(struct
|
|
|
|
let initial_size = 16
|
|
|
|
let resize_policy = Interned.Conservative
|
2018-06-06 15:39:45 +00:00
|
|
|
let order = Interned.Natural
|
2018-05-26 10:14:00 +00:00
|
|
|
end)()
|
2018-03-02 18:44:03 +00:00
|
|
|
|
2018-03-03 13:41:29 +00:00
|
|
|
let of_string = make
|
2018-03-02 18:44:03 +00:00
|
|
|
|
2018-03-03 13:41:29 +00:00
|
|
|
let opam_fn (t : t) = to_string t ^ ".opam"
|
2018-03-02 18:44:03 +00:00
|
|
|
|
2018-03-03 13:41:29 +00:00
|
|
|
let pp fmt t = Format.pp_print_string fmt (to_string t)
|
2018-06-15 05:20:03 +00:00
|
|
|
|
2018-06-18 16:58:45 +00:00
|
|
|
let t = Sexp.Of_sexp.(map string ~f:of_string)
|
2018-03-02 18:44:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2017-02-24 18:21:22 +00:00
|
|
|
type t =
|
2018-03-02 18:44:03 +00:00
|
|
|
{ name : Name.t
|
2017-02-24 18:21:22 +00:00
|
|
|
; path : Path.t
|
|
|
|
; version_from_opam_file : string option
|
|
|
|
}
|
2017-06-08 13:11:31 +00:00
|
|
|
|
2018-03-02 18:44:03 +00:00
|
|
|
let opam_file t = Path.relative t.path (Name.opam_fn t.name)
|