package opam-repository

  1. Overview
  2. Docs

Signature for repository handlers and some helpers for the repository type

type update =
  1. | Update_full of OpamTypes.dirname
    (*

    No previous known state, the full contents have been put in the given temporary directory

    *)
  2. | Update_patch of OpamTypes.filename
    (*

    The given patch file corresponds to the update, i.e. applying it to the local repository with 'patch -p1' would get it to the upstream state

    *)
  3. | Update_empty
    (*

    The repository is already up to date

    *)
  4. | Update_err of exn
    (*

    Failed to obtain the update

    *)

Type returned by repository updates.

module type S = sig ... end

Backend signature

val to_string : OpamTypes.repository -> string

Pretty-print

Compare repositories

Create a local repository on a given path, without remote (only for external tools, not to be mistaken for an opam repo with a local url)

val check_digest : OpamTypes.filename -> OpamHash.t option -> bool

check_digest file expected check that the file digest is the one expected.

val job_text : OpamTypes.repository_name -> string -> 'a OpamProcess.job -> 'a OpamProcess.job

Adds a label to the given job, for the correspondig repository name and action

get_diff parent_dir subdir1 subdir2 computes the diff between the two subdirs of parent_dir, returns None if they are equal, and the corresponding patch otherwise.

Note: this relies on the diff -ruN command, a built-in diff may be more portable -- in particular, -u, -N are not POSIX, and recursive diffs might not be completely reliable. It also assumes text files only, and fails otherwise.

OCaml

Innovation. Community. Security.