package opam-client

  1. Overview
  2. Docs

Functions handling the "opam switch" subcommand

val create : OpamStateTypes.rw OpamStateTypes.global_state -> rt:'a OpamStateTypes.repos_state -> ?synopsis:string -> ?repos:OpamTypes.repository_name list -> update_config:bool -> invariant:OpamTypes.formula -> OpamTypes.switch -> (OpamStateTypes.rw OpamStateTypes.switch_state -> 'ret * OpamStateTypes.rw OpamStateTypes.switch_state) -> 'ret * OpamStateTypes.rw OpamStateTypes.switch_state

Creates and configures a new switch. The given global_state is unlocked once done. update_config sets the switch as current globally, unless it is external.

post can be used to run guarded operations after the switch creation (cleanup will be proposed to the user if they fail). You probably want to call install_compiler there.

val install_compiler : ?additional_installs:OpamTypes.atom list -> ?deps_only:bool -> ?ask:bool -> OpamStateTypes.rw OpamStateTypes.switch_state -> OpamStateTypes.rw OpamStateTypes.switch_state

Used to initially install a compiler's base packages, according to its invariant. ask triggers prompting the user as for normal installs; defaults to false.

val import : OpamStateTypes.rw OpamStateTypes.switch_state -> OpamFile.SwitchExport.t OpamFile.t option -> OpamStateTypes.rw OpamStateTypes.switch_state

Import a file which contains the packages to install.

val export : 'a OpamStateTypes.repos_state -> ?freeze:bool -> ?full:bool -> ?switch:OpamTypes.switch -> OpamFile.SwitchExport.t OpamFile.t option -> unit

Export a file which contains the installed packages. If full is specified and true, export metadata of all installed packages (excluding overlay files) as part of the export. The export will be extended with a map of all extra-files. If freeze is specified and true, VCS urls will be frozen to the specific commit ID. If None is provided as file argument, the export is done to stdout.

val remove : OpamStateTypes.rw OpamStateTypes.global_state -> ?confirm:bool -> OpamTypes.switch -> OpamStateTypes.rw OpamStateTypes.global_state

Remove the given compiler switch, and returns the updated state (unchanged in case confirm is true and the user didn't confirm)

val switch : 'a OpamStateTypes.lock -> OpamStateTypes.rw OpamStateTypes.global_state -> OpamTypes.switch -> unit

Changes the currently active switch

val reinstall : OpamStateTypes.rw OpamStateTypes.switch_state -> OpamStateTypes.rw OpamStateTypes.switch_state

Reinstall the given compiler switch.

val set_invariant_raw : OpamStateTypes.rw OpamStateTypes.switch_state -> OpamTypes.formula -> OpamStateTypes.rw OpamStateTypes.switch_state

Updates the switch invariant and the associated config files, and writes the config file unless show or dry_run are activated globally. Low-level function, see set_invariant for the user-facing function.

val set_invariant : ?force:bool -> OpamStateTypes.rw OpamStateTypes.switch_state -> OpamTypes.formula -> OpamStateTypes.rw OpamStateTypes.switch_state

Sets the packages configured as the current switch compiler base, after some checks and messages.

val show : unit -> unit

Display the current compiler switch.

val list : 'a OpamStateTypes.global_state -> print_short:bool -> unit

List all the available compiler switches.

val get_compiler_packages : ?repos:OpamTypes.repository_name list -> 'a OpamStateTypes.repos_state -> OpamTypes.package_set

Returns all available compiler packages from a repo state

val guess_compiler_invariant : ?repos:OpamTypes.repository_name list -> 'a OpamStateTypes.repos_state -> string list -> OpamFormula.t

Guess a real compiler spec from a list of strings, which may refer to packages with optional version constraints, or just versions. This uses some heuristics.

OCaml

Innovation. Community. Security.