package opam-repository

  1. Overview
  2. Docs

Module OpamRepositorySource

Operations on repositories (update, fetch...) based on the different backends implemented in separate modules

Get the list of packages

Sourceval packages_with_prefixes : OpamTypes.repository -> string option OpamTypes.package_map

Get the list of packages (and their possible prefix)

Repository backends

Sourceval init : OpamTypes.dirname -> OpamTypes.repository_name -> unit OpamProcess.job

Initialize $opam/repo/$repo

Sourceval update : OpamTypes.repository -> unit OpamProcess.job

Update $opam/repo/$repo. Raises Failure in case the update couldn't be achieved.

Sourceval pull_tree : string -> ?cache_dir:OpamTypes.dirname -> ?cache_urls:OpamTypes.url list -> ?working_dir:bool -> OpamTypes.dirname -> OpamHash.t list -> OpamTypes.url list -> unit OpamTypes.download OpamProcess.job

Fetch an URL and put the resulting tree into the supplied directory. The URL must either point to a tree (VCS, rsync) or to a known archive type. In case of an archive, the cache is used and supplied the hashes verified, then the archive uncompressed. In case of a version-controlled URL, it's checked out, or synchronised directly if local and working_dir was set.

Sourceval pull_file : string -> ?cache_dir:OpamTypes.dirname -> ?cache_urls:OpamTypes.url list -> ?silent_hits:bool -> OpamTypes.filename -> OpamHash.t list -> OpamTypes.url list -> unit OpamTypes.download OpamProcess.job

Same as pull_tree, but for fetching a single file.

Sourceval pull_file_to_cache : string -> cache_dir:OpamTypes.dirname -> ?cache_urls:OpamTypes.url list -> OpamHash.t list -> OpamTypes.url list -> unit OpamTypes.download OpamProcess.job

Same as pull_file, but without a destination file: just ensures the file is present in the cache.

Sourceval cache_file : OpamTypes.dirname -> OpamHash.t -> OpamTypes.filename

The file where the file with the given hash is stored under cache at given dirname.

Sourceval revision : OpamTypes.dirname -> OpamTypes.url -> OpamTypes.version option OpamProcess.job

Get the optional revision associated to a backend (git hash, etc.).

Sourceval current_branch : OpamTypes.url -> string option OpamProcess.job

Get the version-control branch for that url. Only applicable for local, version controlled URLs. Returns None in other cases.

Sourceval is_dirty : OpamTypes.url -> bool OpamProcess.job

Returns true if the url points to a local, version-controlled directory that has uncommitted changes

Find a backend

Sourceval find_backend_by_kind : OpamUrl.backend -> (module OpamRepositoryBackend.S)
OCaml

Innovation. Community. Security.