package opam-client

  1. Overview
  2. Docs

Handles concrete actions on packages, like installations and removals

val download_package : OpamStateTypes.rw OpamStateTypes.switch_state -> OpamTypes.package -> [ `Error of string | `Successful of OpamTypes.generic_file option ] OpamProcess.job

download t pkg downloads the source of the package pkg into the local cache. Returns the downloaded file or directory.

extract_package t source pkg extracts and patches the already downloaded source of the package pkg. See download_package to download the sources.

val build_package : OpamStateTypes.rw OpamStateTypes.switch_state -> ?test:bool -> ?doc:bool -> OpamTypes.generic_file option -> OpamTypes.dirname -> OpamTypes.package -> exn option OpamProcess.job

build_package t source build_dir pkg builds the package pkg within build_dir. If source is specified, it is first extracted or copied into build_dir. Returns None on success, Some exn on error. See download_package to download the source.

val install_package : OpamStateTypes.rw OpamStateTypes.switch_state -> ?doc:bool -> ?build_dir:OpamTypes.dirname -> OpamTypes.package -> exn option OpamProcess.job

install_package t pkg installs an already built package. Returns None on success, Some exn on error. Do not update OPAM's metadata. See build_package to build the package.

val removal_needs_download : 'a OpamStateTypes.switch_state -> OpamTypes.package -> bool

Find out if the package source is needed for uninstall

val remove_package : OpamStateTypes.rw OpamStateTypes.switch_state -> ?silent:bool -> ?changes:OpamDirTrack.t -> ?force:bool -> OpamTypes.package -> unit OpamProcess.job

Removes a package. If changes is unspecified, it is read from the package's change file. if force is specified, remove files marked as added in changes even if the files have been modified since.

Returns true whenever remove_package is a no-op.

val cleanup_package_artefacts : OpamStateTypes.rw OpamStateTypes.switch_state -> OpamTypes.package -> unit

Removes auxiliary files related to a package, after checking that they're not needed (even in other switches)

Compute the set of packages which will need to be downloaded to apply a solution. Takes a graph of atomic actions.

OCaml

Innovation. Community. Security.