package opam-format

  1. Overview
  2. Docs

Module OpamFile.ConfigSource

Configuration file: $opam/config

include IO_FILE
Sourcetype t

File contents

Sourceval format_version : OpamVersion.t
Sourceval empty : t

Empty file

Sourceval write : t typed_file -> t -> unit

Write some contents to a file

Sourceval read : t typed_file -> t

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

Sourceval read_opt : t typed_file -> t option

Returns None on non-existing file

Sourceval safe_read : t typed_file -> t

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

Sourceval read_from_channel : ?filename:t typed_file -> in_channel -> t
Sourceval read_from_string : ?filename:t typed_file -> string -> t
Sourceval write_to_channel : ?filename:t typed_file -> out_channel -> t -> unit
Sourceval write_to_string : ?filename:t typed_file -> t -> string
Sourceval root_version : OpamTypes.opam_version

Current root version

Sourceval with_switch : OpamTypes.switch -> t -> t

OCaml switch updates

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

Repository updates

Sourceval with_opam_version : OpamVersion.t -> t -> t

Update opam-version

Sourceval with_opam_root_version : OpamVersion.t -> t -> t
Sourceval with_criteria : (OpamTypes.solver_criteria * string) list -> t -> t
Sourceval with_best_effort_prefix : string -> t -> t
Sourceval with_best_effort_prefix_opt : string option -> t -> t
Sourceval with_solver : OpamTypes.arg list -> t -> t
Sourceval with_solver_opt : OpamTypes.arg list option -> t -> t
Sourceval with_jobs : int -> t -> t
Sourceval with_jobs_opt : int option -> t -> t
Sourceval with_dl_tool : OpamTypes.arg list -> t -> t
Sourceval with_dl_tool_opt : OpamTypes.arg list option -> t -> t
Sourceval with_dl_jobs : int -> t -> t
Sourceval with_dl_cache : OpamTypes.url list -> t -> t
Sourceval with_wrappers : Wrappers.t -> t -> t
Sourceval with_global_variables : (OpamTypes.variable * OpamTypes.variable_contents * string) list -> t -> t
Sourceval with_eval_variables : (OpamTypes.variable * string list * string) list -> t -> t
Sourceval with_validation_hook_opt : OpamTypes.arg list option -> t -> t
Sourceval with_default_compiler : OpamTypes.formula -> t -> t
Sourceval with_default_invariant : OpamTypes.formula -> t -> t
Sourceval with_depext : bool -> t -> t
Sourceval with_depext_run_installs : bool -> t -> t
Sourceval with_depext_cannot_install : bool -> t -> t
Sourceval with_depext_bypass : OpamSysPkg.Set.t -> t -> t
Sourceval opam_version : t -> OpamTypes.opam_version

Return the opam version

Sourceval opam_root_version : t -> OpamTypes.opam_version

Return the opam root version, if not defined returns the default version value 2.1~~previous

Sourceval opam_root_version_opt : t -> OpamTypes.opam_version option

Return the opam root version if defined

Sourceval repositories : t -> OpamTypes.repository_name list

Return the list of repository

Sourceval switch : t -> OpamTypes.switch option

Return the OCaml switch

Sourceval installed_switches : t -> OpamTypes.switch list
Sourceval jobs : t -> int option

Return the number of jobs defined

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

Return the number of download jobs

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

variable, value, docstring

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

variable, command, docstring

Sourceval validation_hook : t -> OpamTypes.arg list option
Sourceval default_compiler : t -> OpamTypes.formula
Sourceval default_invariant : t -> OpamTypes.formula
Sourceval depext : t -> bool
Sourceval depext_run_installs : t -> bool
Sourceval depext_cannot_install : t -> bool
Sourceval depext_bypass : t -> OpamSysPkg.Set.t
Sourceval to_list : ?filename:'a typed_file -> t -> (string * OpamParserTypes.FullPos.value) list

All file fields as print-AST, Fields within sections are accessed through dot-separated paths

Sourcemodule BestEffort : BestEffortRead with type t := t
Sourceval raw_root_version : 'a typed_file -> OpamVersion.t option

Raw read the config file to extract opam-root-version field value.

OCaml

Innovation. Community. Security.