package opam-state

  1. Overview
  2. Docs

doc/opam-state/OpamGlobalState/index.html

Module OpamGlobalStateSource

Loading and handling of the global state of an opam root

Loads the global state (from the opam root obtained through OpamStateConfig.(!r.root))

Sourceval with_ : 'a OpamStateTypes.lock -> ('a OpamStateTypes.global_state -> 'b) -> 'b

Loads the global state as load, and calls the given function while keeping it locked (as per the lock argument), releasing the lock afterwards

Sourceval all_installed : 'a OpamStateTypes.global_state -> OpamTypes.package_set

The set of all installed packages, in any switch

Sourceval switches : 'a OpamStateTypes.global_state -> OpamTypes.switch list
Sourceval fold_switches : (OpamTypes.switch -> OpamTypes.switch_selections -> 'a -> 'a) -> 'b OpamStateTypes.global_state -> 'a -> 'a
Sourceval switch_exists : 'a OpamStateTypes.global_state -> OpamTypes.switch -> bool

Checks a switch for existence: either configured in the opam root, or an existing local switch with a configuration file pointing to the current root

Sourceval installed_versions : 'a OpamStateTypes.global_state -> OpamTypes.name -> OpamTypes.switch list OpamTypes.package_map

Returns the map of installed instances of the package name towards the list of switches they are installed in

Sourceval repos_list : 'a OpamStateTypes.global_state -> OpamTypes.repository_name list

Default list of repositories to get packages from, ordered by decreasing priority. This can be overridden by switch-specific selections, and does not have to include all configured repositories.

Releases any locks on the given global_state

Calls the provided function, ensuring a temporary write lock on the given global state

Writes back the global configuration file ~/.opam/config

Updates the configured list of switches, making sure the current switch is registered if it is set and exists, and removing any non-existing switches. Writes back to disk if possible (ie lock is available)

Sourceval inferred_from_system : string

Description used for system inferred variables

OCaml

Innovation. Community. Security.