package opam-state

  1. Overview
  2. Docs

doc/opam-state/OpamRepositoryState/index.html

Module OpamRepositoryStateSource

loading and handling of the repository state of an opam root (i.e. what is in ~/.opam/repo)

Sourcemodule Cache : sig ... end

Caching of repository loading (marshall of all parsed opam files)

Loads the repository state as load, and calls the given function while keeping it locked (as per the lock argument), releasing the lock afterwards

Sourceval find_package_opt : 'a OpamStateTypes.repos_state -> OpamTypes.repository_name list -> OpamTypes.package -> (OpamTypes.repository_name * OpamFile.OPAM.t) option

Returns the repo of origin and metadata corresponding to a package, if found, from a sorted list of repositories (highest priority first)

Sourceval build_index : 'a OpamStateTypes.repos_state -> OpamTypes.repository_name list -> OpamFile.OPAM.t OpamPackage.Map.t

Given the repos state, and a list of repos to use (highest priority first), build a map of all existing package definitions

Sourceval get_repo : 'a OpamStateTypes.repos_state -> OpamTypes.repository_name -> OpamTypes.repository

Finds a package repository definition from its name (assuming it's in ROOT/repos/)

Sourceval load_opams_from_dir : OpamTypes.repository_name -> OpamTypes.dirname -> OpamFile.OPAM.t OpamPackage.Map.t
Sourceval load_repo : OpamTypes.repository -> OpamFilename.Dir.t -> OpamFile.Repo.t * OpamFile.OPAM.t OpamPackage.Map.t

Load all the metadata within the local mirror of the given repository, without cache

Sourceval get_root : 'a OpamStateTypes.repos_state -> OpamTypes.repository_name -> OpamFilename.Dir.t

Get the (lazily extracted) repository root for the given repository

Sourceval get_repo_root : 'a OpamStateTypes.repos_state -> OpamTypes.repository -> OpamFilename.Dir.t

Same as get_root, but with a repository rather than just a name as argument

Releases any locks on the given repos_state, and cleans the tmp extracted tree if any unless cleanup=false

Sourceval drop : ?cleanup:bool -> 'a OpamStateTypes.repos_state -> unit

Releases any locks on the given repos_state and then ignores it.

Using drop ?cleanup rt is equivalent to ignore (unlock ?cleanup rt), and safer than other uses of ignore where it is not enforced by the type-system that the value is unlocked before it is lost.

Sourceval remove_from_repos_tmp : 'a OpamStateTypes.repos_state -> OpamTypes.repository_name -> unit

Cleanup before removing the repository from temporary table

Sourceval cleanup : 'a OpamStateTypes.repos_state -> unit

Clears tmp files corresponding to a repo state (uncompressed repository contents)

Calls the provided function, ensuring a temporary write lock on the given repository state

Writes the repositories config file back to disk

Sourceval check_last_update : unit -> unit

Display a warning if repository has not been updated since 3 weeks

OCaml

Innovation. Community. Security.