Module Omod_support.Pkg

module Pkg: sig .. end
Packages.

Packages represents sets of compilation objects indexed from a root Omod_support.Conf.libdir.



Packages


type t = Omod_support.Cobj.pkg_id 
The type for packages.
val of_dir : ?err:Omod_support.Log.t -> Omod.fpath -> t list
of_dir ~err dir are the packages found in dir. This is simply all the directory names inside dir and an ocaml package which points to ocamlc -where. err is used to report file system errors (defaults to Omod_support.Log.err).
val find_cobjs : ?err:Omod_support.Log.t ->
?acc:Omod_support.Cobj.t list ->
t -> Omod_support.Cobj.t list
find_cobjs ~err ~note ~acc pkg are the compilation objects contained in pkg pkg added to acc (defaults to []). err is used to report errors (defaults to Omod_support.Log.nil).
val equal : t -> t -> bool
equal p0 p1 is true iff p0 and p1 have the same identifiers.
val compare : t -> t -> int
compare is a total order on packages compatible with Omod_support.Pkg.equal.
val pp : Format.formatter -> t -> unit
pp formats package identifiers.
val pp_name : Format.formatter -> t -> unit
pp_name formats the name of package identifiers.
module Set: Set.S  with type elt = t
Package identifier sets.
module Map: Map.S  with type key = t
Package identifier maps.

Package signatures


type signature = Omod_support.Digest.t 
The type for package signatures.
val signature : ?err:Omod_support.Log.t -> t -> signature
signature ~err pkg is a signature for package pkg. This is the digest of the mtimes of all the cobjs of pkg. err is used to report error (defaults to Omod_support.Log.err).

Package information


type info 
The type for package information.
val info : signature:signature ->
cobjs:Omod_support.Cobj.t list -> info
info ~signature ~cobjs is information for a package.
val info_signature : info -> signature
info_signature i is the package's signature.
val info_cobjs : info -> Omod_support.Cobj.t list
info_signature i is the package's compilation objects.
val pp_info : Format.formatter -> info -> unit
pp_info formats package information.

Package databases


type db = info Map.t 
The type for package databases. Maps package names to their information.
val db : ?err:Omod_support.Log.t ->
?note:Omod_support.Log.t ->
?progress:bool ->
?init:db -> t list -> db
db ~err ~note ~progress ~init pkgs is database init (dfeaults to Map.empty) with packages pkgs added. Their information is computed by the function using err to report errors (defaults to Omod_support.Log.err), note to report indexing operations (defaults to Omod_support.Log.nil) and progress to indicate if progress should be reported on note (defaults to false).
val db_to_name_db : db ->
(t * info) Omod.Private.String.Map.t
db_to_name_db db maps package names (rather than identifiers) to their information.
val db_to_cobj_index : db -> Omod_support.Cobj.Index.t
db_to_cobj_index db is a compilatino object with the contents of the packages of db.
type diff = [ `Changed of t * signature
| `Gone of t
| `New of t * signature ]

The type for package database differences.
val pp_diff : diff Omod.Private.Fmt.t
pp_diff formats package database differences.
val diff : db ->
(t * signature) list ->
diff list
diff db sgs is the list of difference between db and package signatures sgs.
val update : ?err:Omod_support.Log.t ->
?note:Omod_support.Log.t ->
?progress:bool ->
db -> diff list -> db
udpate ~err ~note ~progress db diffs is db updated according to diffs. err is used to report errors (defaults to Omod_support.Log.err), note to report indexing operations (defaults to Omod_support.Log.nil) and progress to indicate if progress should be reported on note (defaults to false).