opam-state

State library for opam 2.1
Module OpamUpdate

Update the given repositories from their upstream, and returns the updated state. This also saves the updated cached state, and the updated repository config (it may be changed by e.g. redirects). The returned list is the list of repositories for which the update failed.

update_dev_packages t checks for upstream changes for packages first in the switch cache and then in the global cache. Return the packages whose contents have changed upstream.

Packages that are members of the working_dir and are bound to a local directory under version control are synchronised with its working state, bypassing version control.

Side-effect: update the reinstall file, adding installed changed packages to the current switch to-reinstall set.

The returned boolean is true if all updates were successful.

Updates a single dev or pinned package from its upstream. If working_dir is set, and the package is bound to a local, version-controlled dir, use the working dir state instead of what has been committed to version control.

Returns true if changed, false otherwise, and a switch_state update function, applying possible changes in packages metadata

A subset of update_dev_packages that only takes packages names and only works on pinned packages. Also updates the reinstall file of the current switch

Updates a dev pinned package from its upstream; returns true if changed, false otherwise, and a switch_state update function that applies possible changes in packages metadata. Updates the on-disk overlay

val download_package_source : 'a OpamStateTypes.switch_state -> OpamTypes.package -> OpamTypes.dirname -> (string OpamTypes.download option * (string * string OpamTypes.download) list) OpamProcess.job

Download or synchronise the upstream source for the given package into the given directory. Also places all of the package extra files (that have a known hash) into the cache. For non-VC remotes, verifies the checksum if any.

Stops on first error. The extra downloads list is reverted, so that the error is always first if any.

Does not print the results as it used to.

val cleanup_source : 'a OpamStateTypes.switch_state -> OpamFile.OPAM.t option -> OpamFile.OPAM.t -> unit

cleanup_source old_opam_option new_opam checks if the remote URL has changed between old_opam_option and new_opam, and, depending on that, cleans up the source directory of the package (OpamPath.Switch.sources) if needed.

val fetch_dev_package : OpamFile.URL.t -> OpamTypes.dirname -> ?working_dir:bool -> ?subpath:string -> OpamTypes.package -> unit OpamTypes.download OpamProcess.job

Low-level function to retrieve the package source into its local cache