package opam-state

  1. Overview
  2. Docs

Module OpamSwitchActionSource

Switch-related actions and changes

Sourceval create_empty_switch : OpamStateTypes.rw OpamStateTypes.global_state -> ?synopsis:string -> ?repos:OpamTypes.repository_name list -> OpamTypes.switch -> OpamStateTypes.rw OpamStateTypes.global_state

Initialises a new switch with the given name in the given opam root, registers it in the global config and returns the updated global state

Writes the current state file to disk (installed, pinned, root packages etc.). Unless OpamStateConfig.(!r.dryrun)

Updates the defined default switch and loads its state; fails and exits with a message if the switch is external

Sourceval gen_switch_config : OpamTypes.dirname -> ?synopsis:string -> ?repos:OpamTypes.repository_name list -> OpamTypes.switch -> OpamFile.Switch_config.t

Create the default global_config structure for a switch, including default prefix

Sourceval install_switch_config : OpamTypes.dirname -> OpamTypes.switch -> OpamFile.Switch_config.t -> unit

(Re-)install the configuration for a given root and switch

Sourceval install_metadata : OpamStateTypes.rw OpamStateTypes.switch_state -> OpamTypes.package -> unit

Add the package metadata to the switch-local cache of installed packages

Sourceval remove_metadata : OpamStateTypes.rw OpamStateTypes.switch_state -> OpamTypes.package_set -> unit

Remove the metadata of the package from the switch-local cache of installed packages

Sourceval add_to_reinstall : OpamStateTypes.rw OpamStateTypes.switch_state -> unpinned_only:bool -> OpamTypes.package_set -> OpamStateTypes.rw OpamStateTypes.switch_state

Update the on-disk set of packages marked to reinstall on the current switch (excepting compiler packages, and pinned packages if unpinned_only is set)

Sourceval add_to_installed : OpamStateTypes.rw OpamStateTypes.switch_state -> ?root:bool -> OpamTypes.package -> OpamStateTypes.rw OpamStateTypes.switch_state

Updates the package selections and switch config to take into account the given newly installed package. The updated state is written to disk unless OpamStateConfig.(!r.dry_run) and returned.

Sourceval remove_from_installed : ?keep_as_root:bool -> OpamStateTypes.rw OpamStateTypes.switch_state -> OpamTypes.package -> OpamStateTypes.rw OpamStateTypes.switch_state

Updates the package selections and switch config to take into account the removed package. The updated state is written to disk unless OpamStateConfig.(!r.dry_run), and returned. If keep_as_root, the package isn't removed from the switch state installed_roots set.

Sourceval update_switch_state : ?installed:OpamTypes.package_set -> ?installed_roots:OpamTypes.package_set -> ?reinstall:OpamTypes.package_set -> ?pinned:OpamTypes.package_set -> OpamStateTypes.rw OpamStateTypes.switch_state -> OpamStateTypes.rw OpamStateTypes.switch_state

Update the switch selections with the supplied optional arguments. Changes are written to disk and returned

OCaml

Innovation. Community. Security.