package opam-repository

  1. Overview
  2. Docs

Module OpamRepositoryRootSource

This module abstract the notion of repository root over its concrete implementation (could be a database, a file, a directory, etc.)

Sourcemodule Dir : sig ... end

Repository root implemented as a directory

Sourcemodule Tgz : sig ... end
Sourceval make_tar_gz : Tgz.t -> Dir.t -> unit
Sourceval extract_in_job : Tgz.t -> Dir.t -> exn option OpamProcess.job
Sourcetype t =
  1. | Dir of Dir.t
  2. | Tgz of Tgz.t
Sourceval quarantine : t -> t

quarantine repo_root returns a temporary repository root dedicated to repo_root. the returned repository is not created on disk and points to a statically known repository located in the same parent directory as repo_root.

Sourceval backup : inn:OpamTypes.dirname -> t -> t
Sourceval remove : t -> unit
Sourceval is_empty : t -> bool option
Sourceval make_empty : t -> unit
Sourceval dirname : t -> OpamTypes.dirname
Sourceval basename : t -> OpamTypes.basename
Sourceval to_string : t -> string
Sourceval remove_prefix_dir : t -> OpamTypes.dirname -> OpamTypes.unix_dirname
Sourceval string_of_backend : t -> string
Sourceval copy : src:t -> dst:t -> unit
Sourceval move : src:t -> dst:t -> unit
Sourceval exists : t -> bool
Sourceval read_file : (module OpamFile.IO_FILE with type t = 'a) -> ?safe:bool -> t -> ?filename:'a OpamFile.t -> string -> 'a
Sourceval patch : allow_unclean:bool -> [ `Patch_file of OpamTypes.filename | `Patch_diffs of Patch.t list ] -> t -> (Patch.operation list, exn) result
Sourceval delayed_read_repo : t -> bool * (unit -> OpamFile.Repo.t)

Returns a pair (exists, f) where exists tells whether the repo file exists in the repository and f reads it

Remove repo_name repository roots, directory and archive, if present

Sourceval on_dir : (OpamTypes.dirname -> 'a) -> t -> 'a

Applies the function in the repository root directory. If repository root is an archive, it uncompress it, applies the function and update archive with the changed directory.