module OpamPackage: sig
.. end
Package name and versions
module Version: sig
.. end
Versions
module Name: sig
.. end
Names
include OpamMisc.ABSTRACT
Package (name x version) pairs
val name : t -> Name.t
Return the package name
val of_string_opt : string -> t option
Return None if nv
is not a valid package name
val version : t -> Version.t
Return the version name
val create : Name.t -> Version.t -> t
Create a new pair (name x version)
val of_filename : all:bool -> OpamFilename.t -> t option
Create a new pair from a filename. This function extracts $name and $version from /path/to/$name.$version.XXX with
various heuristics. If all
is unset, discard "opam" and "url"
files.
val of_dirname : OpamFilename.Dir.t -> t option
Create a new pair from a directory name. This function extracts $name and $version from /path/to/$name.$version/
val to_map : Set.t -> Version.Set.t Name.Map.t
Convert a set of pairs to a map name -> versions
val versions_of_packages : Set.t -> Version.Set.t
Extract the versions from a collection of packages
val versions_of_name : Set.t -> Name.t -> Version.Set.t
Return the list of versions for a given package
val names_of_packages : Set.t -> Name.Set.t
Extract the naes from a collection of packages
val packages_of_name : Set.t -> Name.t -> Set.t
Return all the packages with the given names
val compare : t -> t -> int
Compare two packages
val equal : t -> t -> bool
Are two packages equal ?
val hash : t -> int
Hash a package
val list : OpamFilename.Dir.t -> Set.t
List all the .opam files and the package directories in a given
path
Errors
val unknown : Name.t -> Version.t option -> 'a
Unknown package: either the name is unknown, or the version does
not exist.
val unavailable : Name.t -> Version.t option -> 'a
Unavailable package: the package exists in the database, but it is
not available due to compiler/OS constraints.
val unavailable_because_pinned : Name.t -> Version.t option -> 'a
Unavailable because the package is pinned.