Up

module OpamRepository

: sig

Mangagement of OPAM repositories.

include OpamMisc.ABSTRACT with type t := OpamTypes.repository
#
exception Unknown_backend
#
val default_address : OpamTypes.address

Default repository address

#
val to_string : OpamTypes.repository -> string

Pretty-print

#
val compare : OpamTypes.repository -> OpamTypes.repository -> int

Compare repositories

#
val default : unit -> OpamTypes.repository

Default repository

#
val local : OpamTypes.dirname -> OpamTypes.repository

Create a local repository on a given path

#
val packages : OpamTypes.repository -> OpamTypes.package_set

Get the list of packages

#
val packages_with_prefixes : OpamTypes.repository -> string option OpamTypes.package_map

Get the list of packages (and their eventual prefixes)

#
val compilers : OpamTypes.repository -> OpamTypes.compiler_set

Get the list of all compiler

#
val compilers_with_prefixes : OpamTypes.repository -> string option OpamTypes.compiler_map

Get the list of compilers (and their eventual prefixes)

Repository Collection Operations

#
val sort : OpamTypes.repository OpamTypes.repository_name_map -> OpamTypes.repository list

Sort a collection of repositories by priority

#
val package_index : OpamTypes.repository OpamTypes.repository_name_map -> (OpamTypes.repository_name * string option) OpamTypes.package_map

Generate a package index from a collection of repositories

#
val compiler_index : OpamTypes.repository OpamTypes.repository_name_map -> (OpamTypes.repository_name * string option) OpamTypes.compiler_map

Generate a compiler index from a collection of repositories

State

#
val url_checksum : OpamFilename.t -> OpamTypes.checksums

Get the meaningful checksum off an url file

#
val package_files : OpamTypes.repository -> string option -> OpamTypes.package -> archive:bool -> OpamTypes.filename list

Get all the package files

#
val package_state : OpamTypes.repository -> string option -> OpamTypes.package -> [
| `all
| `partial of bool
] -> OpamTypes.checksums

Compute a package state (ie. a list of checksums).

#
val compiler_files : OpamTypes.repository -> string option -> OpamTypes.compiler -> OpamTypes.filename list

Get all the compiler files

#
val compiler_state : OpamTypes.repository -> string option -> OpamTypes.compiler -> OpamTypes.checksums

Compute a compiler state (ie. a list of checksums).

Repository backends

#
val init : OpamTypes.repository -> unit

Initialize $opam/repo/$repo

#
val update : OpamTypes.repository -> unit

Update $opam/repo/$repo.

#
val check_version : OpamTypes.repository -> unit

Error and exit on incompatible version

#
module type BACKEND = sig

Backend signature

#
val pull_url : OpamTypes.package -> OpamTypes.dirname -> string option -> OpamTypes.address -> OpamTypes.generic_file OpamTypes.download

pull_url package local_dir checksum remote_url pull the contents of remote_url into local_dir. Can return either a file or a directory. checksum is the optional expected checksum.

#
val pull_repo : OpamTypes.repository -> unit

pull_repo pull the contents of a repository.

#
val pull_archive : OpamTypes.repository -> OpamTypes.filename -> OpamTypes.filename OpamTypes.download

pull_archive repo archive pull archive in the given repository.

#
val revision : OpamTypes.repository -> OpamTypes.version option

Return the (optional) revision of a given repository. Only useful for VCS backends.

end
#
val pull_url : OpamTypes.repository_kind -> OpamTypes.package -> OpamTypes.dirname -> string option -> OpamTypes.address list -> OpamTypes.generic_file OpamTypes.download

Download an url. Several mirrors can be provided, in which case they will be tried in order in case of an error.

#
val pull_url_and_fix_digest : OpamTypes.repository_kind -> OpamTypes.package -> OpamTypes.dirname -> string -> OpamTypes.filename -> OpamTypes.address list -> OpamTypes.generic_file OpamTypes.download

Pull and fix the resulting digest

#
val check_digest : OpamTypes.filename -> string option -> unit

check_digest file expected check that the file digest is the one expected.

#
val pull_archive : OpamTypes.repository -> OpamTypes.package -> OpamTypes.filename OpamTypes.download

Pull an archive in a repository

#
val revision : OpamTypes.repository -> OpamTypes.version option

Get the optional revision associated to a backend.

#
val make_archive : ?gener_digest:bool -> OpamTypes.repository -> string option -> OpamTypes.package -> unit

make_archive ?gener_digest repo prefix package builds the archive for the given package. By default, the digest that appears in $NAME.$VERSION/url is not modified, unless gener_digest is set.

#
val register_backend : OpamTypes.repository_kind -> (module BACKEND) -> unit

Register a repository backend

#
val find_backend : OpamTypes.repository_kind -> (module BACKEND)

Find a backend

Misc

#
module Parallel : OpamParallel.SIG with type G.V.t = OpamTypes.repository

Parallel iterations

end