package opam-format

  1. Overview
  2. Docs

Module OpamPackageSource

The package type, and package name type (name+version, values often called "nv" in the code)

Package name and versions

Sourcemodule Version : sig ... end

Versions

Sourcemodule Name : sig ... end

Names

Sourcetype t = private {
  1. name : Name.t;
  2. version : Version.t;
}

Package (name x version) pairs

include OpamStd.ABSTRACT with type t := t
Sourceval of_string : string -> t
Sourceval to_string : t -> string
Sourcemodule Set : OpamStd.SET with type elt = t
Sourcemodule Map : OpamStd.MAP with type key = t
Sourceval name : t -> Name.t

Return the package name

Sourceval of_string_opt : string -> t option

Return None if nv is not a valid package name

Sourceval version : t -> Version.t

Return the version name

Sourceval create : Name.t -> Version.t -> t

Create a new pair (name x version)

Sourceval name_to_string : t -> string

To fit in the GenericPackage type, for generic display functions

Sourceval version_to_string : t -> string
Sourceval of_filename : OpamFilename.t -> t option

Guess the package name from a filename. This function extracts name and version from /path/to/$name.$version/opam, or /path/to/$name.$version.opam

Sourceval of_dirname : OpamFilename.Dir.t -> t option

Guess the package name from a directory name. This function extracts $name and $version from /path/to/$name.$version/

Sourceval of_archive : OpamFilename.t -> t option

Guess the package name from an archive file. This function extract $name and $version from /path/to/$name.$version+opam.tar.gz

Convert a set of pairs to a map name -> versions

The converse of to_map

Sourceval keys : 'a Map.t -> Set.t

Returns the keys in a package map as a package set

Sourceval versions_of_packages : Set.t -> Version.Set.t

Extract the versions from a collection of packages

Sourceval versions_of_name : Set.t -> Name.t -> Version.Set.t

Return the list of versions for a given package

Sourceval names_of_packages : Set.t -> Name.Set.t

Extract the naes from a collection of packages

Sourceval has_name : Set.t -> Name.t -> bool

Returns true if the set contains a package with the given name

Sourceval packages_of_name : Set.t -> Name.t -> Set.t

Return all the packages with the given name

Sourceval packages_of_name_map : 'a Map.t -> Name.t -> 'a Map.t
Sourceval package_of_name : Set.t -> Name.t -> t

Return a package with the given name

Sourceval package_of_name_opt : Set.t -> Name.t -> t option

Return a package with the given name, if any

Sourceval packages_of_names : Set.t -> Name.Set.t -> Set.t

Return all the packages with one of the given names

Sourceval filter_name_out : Set.t -> Name.t -> Set.t

Removes all packages with the given name from a set of packages

Sourceval max_version : Set.t -> Name.t -> t

Return the maximal available version of a package name from a set. Raises Not_found if no such package available.

Sourceval compare : t -> t -> int

Compare two packages

Sourceval equal : t -> t -> bool

Are two packages equal?

Sourceval hash : t -> int

Hash a package

Return all the package descriptions in a given directory

Sourceval prefixes : OpamFilename.Dir.t -> string option Map.t

Return all the package descriptions in the current directory (and their eventual prefixes).

Errors

Sourcemodule Graph : OpamParallel.GRAPH with type V.t = t

Parallel executions.

OCaml

Innovation. Community. Security.