Implement Lib.package
Gets the opam package of a library for a public or installed library
This commit is contained in:
parent
b59dab57da
commit
69c5a4a79d
|
@ -353,6 +353,15 @@ let is_local t = Path.is_local t.obj_dir
|
|||
|
||||
let status t = t.status
|
||||
|
||||
let package t =
|
||||
match t.status with
|
||||
| Installed ->
|
||||
Some (Findlib.root_package_name t.name
|
||||
|> Package.Name.of_string)
|
||||
| Public p -> Some p.name
|
||||
| Private _ ->
|
||||
None
|
||||
|
||||
let to_id t : Id.t =
|
||||
{ unique_id = t.unique_id
|
||||
; path = t.src_dir
|
||||
|
|
|
@ -43,6 +43,8 @@ end
|
|||
|
||||
val status : t -> Status.t
|
||||
|
||||
val package : t -> Package.Name.t option
|
||||
|
||||
(** Operations on list of libraries *)
|
||||
module L : sig
|
||||
type nonrec t = t list
|
||||
|
|
Loading…
Reference in New Issue