package opam-state
Install
Dune Dependency
Authors
-
David Allsopp
-
VVincent Bernardoff <vb@luminar.eu.org>
-
RRaja Boujbel <raja.boujbel@ocamlpro.com>
-
KKate Deplaix <kit-ty-kate@outlook.com>
-
RRoberto Di Cosmo <roberto@dicosmo.org>
-
TThomas Gazagnaire <thomas@gazagnaire.org>
-
LLouis Gesbert <louis.gesbert@ocamlpro.com>
-
FFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
-
AAnil Madhavapeddy <anil@recoil.org>
-
GGuillem Rieu <guillem.rieu@ocamlpro.com>
-
RRalf Treinen <ralf.treinen@pps.jussieu.fr>
-
FFrederic Tuong <tuong@users.gforge.inria.fr>
Maintainers
Sources
md5=7a902ac41ad9da83a0e80576c9d9c122
sha512=a447dab252e93ea81e0cf4ab1a64c9386911af5fd45344f1ac5f71eb0abb472f660e542c645e3b0657715b5ed81903a581152cdac9e24cabc72c5bf654743ae8
doc/opam-state/OpamRepositoryState/index.html
Module OpamRepositoryState
Source
loading and handling of the repository state of an opam root (i.e. what is in ~/.opam/repo)
val load :
'a OpamStateTypes.lock ->
[< OpamStateTypes.unlocked ] OpamStateTypes.global_state ->
'a OpamStateTypes.repos_state
val with_ :
'a OpamStateTypes.lock ->
[< OpamStateTypes.unlocked ] OpamStateTypes.global_state ->
('a OpamStateTypes.repos_state -> 'b) ->
'b
Loads the repository state as load
, and calls the given function while keeping it locked (as per the lock
argument), releasing the lock afterwards
val 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)
val 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
val 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/)
val load_opams_from_dir :
OpamTypes.repository_name ->
OpamTypes.dirname ->
OpamFile.OPAM.t OpamPackage.Map.t
val 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
val get_root :
'a OpamStateTypes.repos_state ->
OpamTypes.repository_name ->
OpamFilename.Dir.t
Get the (lazily extracted) repository root for the given repository
val 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
val unlock :
?cleanup:bool ->
'a OpamStateTypes.repos_state ->
OpamStateTypes.unlocked OpamStateTypes.repos_state
Releases any locks on the given repos_state, and cleans the tmp extracted tree if any unless cleanup=false
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.
val remove_from_repos_tmp :
'a OpamStateTypes.repos_state ->
OpamTypes.repository_name ->
unit
Cleanup before removing the repository from temporary table
Clears tmp files corresponding to a repo state (uncompressed repository contents)
val with_write_lock :
?dontblock:bool ->
'a OpamStateTypes.repos_state ->
(OpamStateTypes.rw OpamStateTypes.repos_state ->
'b * OpamStateTypes.rw OpamStateTypes.repos_state) ->
'b * 'a OpamStateTypes.repos_state
Calls the provided function, ensuring a temporary write lock on the given repository state
Writes the repositories config file back to disk
Display a warning if repository has not been updated since 3 weeks