OpamRepositoryStateloading and handling of the repository state of an opam root (i.e. what is in ~/.opam/repo)
module Cache : sig ... endCaching of repository loading (marshall of all parsed opam files)
val load :
'a OpamStateTypes.lock ->
[< OpamStateTypes.unlocked ] OpamStateTypes.global_state ->
'a OpamStateTypes.repos_stateval with_ :
'a OpamStateTypes.lock ->
[< OpamStateTypes.unlocked ] OpamStateTypes.global_state ->
('a OpamStateTypes.repos_state -> 'b) ->
'bLoads 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) optionReturns 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.tGiven 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.repositoryFinds 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.tval load_opams_from_diff :
OpamTypes.repository ->
Patch.operation list ->
'a OpamStateTypes.repos_state ->
OpamFile.OPAM.t OpamTypes.package_mapload_opams_from_diff repo diffs rt incrementally updates package definitions by processing only changed files.
Starting from existing packages in rt.repo_opams, it:
val load_repo :
OpamTypes.repository ->
OpamFilename.Dir.t ->
OpamFile.Repo.t * OpamFile.OPAM.t OpamPackage.Map.tLoad 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.tGet the (lazily extracted) repository root for the given repository
val get_repo_root :
'a OpamStateTypes.repos_state ->
OpamTypes.repository ->
OpamFilename.Dir.tSame as get_root, but with a repository rather than just a name as argument
val get_repo_files :
'a OpamStateTypes.repos_state ->
OpamTypes.repository_name ->
string ->
(OpamTypes.basename * string Stdlib.Lazy.t) listget_repo_files rt name dir Returns files in repository root of repository name from subdirectory dir. The returned list contains the basenames of files, and the content of each file lazily. It is intended to be used with OpamFile.get_extra_files to retrieve `files/` files.
val unlock :
?cleanup:bool ->
'a OpamStateTypes.repos_state ->
OpamStateTypes.unlocked OpamStateTypes.repos_stateReleases any locks on the given repos_state, and cleans the tmp extracted tree if any unless cleanup=false
val drop : ?cleanup:bool -> 'a OpamStateTypes.repos_state -> unitReleases 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 ->
unitCleanup before removing the repository from temporary table
val cleanup : 'a OpamStateTypes.repos_state -> unitClears 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_stateCalls the provided function, ensuring a temporary write lock on the given repository state
val write_config : OpamStateTypes.rw OpamStateTypes.repos_state -> unitWrites the repositories config file back to disk