package opam-format

  1. Overview
  2. Docs

Configuration file: $opam/config

include IO_FILE
type t

File contents

val empty : t

Empty file

val write : t typed_file -> t -> unit

Write some contents to a file

val read : t typed_file -> t

Read file contents. Raise an error if the file does not exist.

val read_opt : t typed_file -> t option

Returns None on non-existing file

val safe_read : t typed_file -> t

Read file contents. Return empty if the file does not exist.

val read_from_channel : ?filename:t typed_file -> Pervasives.in_channel -> t
val read_from_string : ?filename:t typed_file -> string -> t
val write_to_channel : ?filename:t typed_file -> Pervasives.out_channel -> t -> unit
val write_to_string : ?filename:t typed_file -> t -> string
val with_switch : OpamTypes.switch -> t -> t

OCaml switch updates

val with_switch_opt : OpamTypes.switch option -> t -> t
val with_installed_switches : OpamTypes.switch list -> t -> t
val with_repositories : OpamTypes.repository_name list -> t -> t

Repository updates

val with_opam_version : OpamVersion.t -> t -> t

Update opam-version

val with_criteria : (OpamTypes.solver_criteria * string) list -> t -> t
val with_solver : OpamTypes.arg list -> t -> t
val with_solver_opt : OpamTypes.arg list option -> t -> t
val with_jobs : int -> t -> t
val with_dl_tool : OpamTypes.arg list -> t -> t
val with_dl_tool_opt : OpamTypes.arg list option -> t -> t
val with_dl_jobs : int -> t -> t
val with_dl_cache : OpamTypes.url list -> t -> t
val with_wrappers : Wrappers.t -> t -> t
val with_global_variables : (OpamTypes.variable * OpamTypes.variable_contents * string) list -> t -> t
val with_eval_variables : (OpamTypes.variable * string list * string) list -> t -> t
val with_validation_hook_opt : OpamTypes.arg list option -> t -> t
val with_default_compiler : OpamTypes.formula -> t -> t
val opam_version : t -> OpamTypes.opam_version

Return the OPAM version

val repositories : t -> OpamTypes.repository_name list

Return the list of repository

val switch : t -> OpamTypes.switch option

Return the OCaml switch

val installed_switches : t -> OpamTypes.switch list
val jobs : t -> int

Return the number of jobs

val dl_tool : t -> OpamTypes.arg list option
val dl_jobs : t -> int

Return the number of download jobs

val dl_cache : t -> OpamTypes.url list
val criteria : t -> (OpamTypes.solver_criteria * string) list
val solver : t -> OpamTypes.arg list option
val wrappers : t -> Wrappers.t
val global_variables : t -> (OpamTypes.variable * OpamTypes.variable_contents * string) list

variable, value, docstring

val eval_variables : t -> (OpamTypes.variable * string list * string) list

variable, command, docstring

val validation_hook : t -> OpamTypes.arg list option
val default_compiler : t -> OpamTypes.formula
OCaml

Innovation. Community. Security.