package opam-lib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Mangagement of OPAM repositories.

include OpamMisc.ABSTRACT with type t := OpamTypes.repository
val of_string : string -> OpamTypes.repository

Create an abstract value from a string

Convert an abstract value to a JSON object

exception Unknown_backend
val default_address : OpamTypes.address

Default repository address

val to_string : OpamTypes.repository -> string

Pretty-print

Compare repositories

val default : unit -> OpamTypes.repository

Default repository

Create a local repository on a given path

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)

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

Sort a collection of repositories by priority

Generate a package index from a collection of repositories

Generate a compiler index from a collection of repositories

State

val url_checksum : OpamFilename.t -> OpamTypes.checksums

Get the package archive 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). If `partial archive, only the checksum of the archive within the url file (instead of the file itself), of the files/ subdirectory, and of the archive if set are returned.

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

Initialize $opam/repo/$repo

Update $opam/repo/$repo.

val check_version : OpamTypes.repository -> unit OpamProcess.job

Error and exit on incompatible version

module type BACKEND = sig ... end

Backend signature

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

Pull and fix the resulting digest

val check_digest : OpamTypes.filename -> string option -> bool

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

Pull an archive in a repository

Get the optional revision associated to a backend.

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

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

Parallel iterations

OCaml

Innovation. Community. Security.