Module OpamRepositoryRoot

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

module Dir : sig ... end

Repository root implemented as a directory

module Tgz : sig ... end
val make_tar_gz : Tgz.t -> Dir.t -> unit
val extract_in_job : Tgz.t -> Dir.t -> exn option OpamProcess.job
type t =
  1. | Dir of Dir.t
  2. | Tgz of Tgz.t
val 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.

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

val remove_both : OpamTypes.dirname -> OpamTypes.repository_name -> unit

Remove repo_name repository roots, directory and archive, if present

val 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.

val root_exists : OpamTypes.dirname -> OpamTypes.repository_name -> bool