Module Topkg.Private.Opam.File

module File: sig .. end
opam package file access.

Normally opam metadata access is only needed at distribution time and this is handled by Topkg_care.Opam.File using the opam-format library.

However there is one case where we want to be able to access the metadata from Topkg: on pin builds where the watermarking process needs to be run to turn the repo into a pseudo-distribution.

Since we don't want Topkg to have any dependency and that opam currently doesn't allow to consult the fields of arbitrary opam files (see issue #2446) we assume a pin build has the topkg tool installed and call to it to get the opam fields for watermarking (if topkg is unavailable the watermarks are simply undefined).



opam file


type t = (string * string list) list 
The type for a simplified model the fields of an opam file. See Topkg_care.Opam.File.
val codec : t Topkg.Private.Codec.t
codec is a codec for opam file fields.
val fields : Topkg.fpath -> (string * string list) list Topkg.result
fields file are the fields of the opam file file which are obtained by calling the topkg topkg executable.