package opam-format

  1. Overview
  2. Docs

Handles all OPAM file formats as record types and submodules, conversion to and from syntax

Functions to read and write OPAM configuration files in a typed way

type 'a t = private OpamTypes.filename

Associate a type to a filename through a phantom type

type 'a typed_file = 'a t
val make : OpamTypes.filename -> 'a t
val filename : 'a t -> OpamTypes.filename
val to_string : 'a t -> string
val exists : 'a t -> bool
module type IO_FILE = sig ... end

All Configuration files satisfy this signature

module Lines : IO_FILE with type t = string list list

Lines of space-separated words.

module Wrappers : sig ... end

Command wrappers for package scripts

module Config : sig ... end

Configuration file: $opam/config

module InitConfig : sig ... end

Init config file /etc/opamrc

module Descr : sig ... end

Package descriptions: $opam/descr/

module URL : sig ... end
module OPAM : sig ... end

OPAM files

module Aliases : IO_FILE with type t = string OpamTypes.switch_map

Compiler aliases: $opam/aliases. Deprecated, used only for migration

module LegacyState : sig ... end

Switch state file as table, also used for import/export. This includes compiler and root packages information, as well as pinned packages and their target (but not their local metadata).

module SwitchSelections : sig ... end

A newer format for switch state, using the opam file syntax rather than a table. This is more readable and extensible.

module SwitchExport : sig ... end

An extended version of SwitchSelections that can include full opam files as package "name" {} sections, for storing overlays

module PkgList : IO_FILE with type t = OpamTypes.package_set

A simple list of packages and versions: (used for the older $opam/$switch/{installed,installed_roots}, still needed to migrate from 1.2 repository, and for reinstall)

module Environment : IO_FILE with type t = OpamTypes.env_update list

Cached environment updates (<switch>/environment)

module Comp : sig ... end

Compiler version $opam/compilers/. Deprecated, only used to upgrade old data

Configuration files

module Dot_install : sig ... end

.install files

module Changes : sig ... end

.changes files, bound to the OpamDirTrack module

module Dot_config : sig ... end

.config files

Repository files

Association between package names and repositories

Repository config: $opam/repo/$repo/config. Deprecated, for migration only

module Switch_config : sig ... end
module Pinned_legacy : sig ... end

Pinned package files (only used for migration from 1.2, the inclusive State module is now used instead)

module Repo : sig ... end

Repository metadata

module Stats : sig ... end
module Syntax : sig ... end

Helper module for manipulation of the raw syntax (opamfile) format. (the specific file handling modules are derived from this one)

OCaml

Innovation. Community. Security.