package opam-lib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t = private {
  1. root_dir : OpamFilename.Dir.t;
  2. current_switch : OpamSwitch.t;
  3. switch_from : [ `Env | `Command_line | `Default ];
  4. jobs : int Stdlib.Lazy.t;
  5. dl_jobs : int;
  6. external_tags : string list;
  7. keep_build_dir : bool;
  8. no_base_packages : bool;
  9. build_test : bool;
  10. build_doc : bool;
  11. show : bool;
  12. dryrun : bool;
  13. fake : bool;
  14. makecmd : string Stdlib.Lazy.t;
  15. json_out : string option;
}
type 'a options_fun = ?root_dir:OpamFilename.Dir.t -> ?current_switch:OpamSwitch.t -> ?switch_from:[ `Env | `Command_line | `Default ] -> ?jobs:int Stdlib.Lazy.t -> ?dl_jobs:int -> ?external_tags:string list -> ?keep_build_dir:bool -> ?no_base_packages:bool -> ?build_test:bool -> ?build_doc:bool -> ?show:bool -> ?dryrun:bool -> ?fake:bool -> ?makecmd:string Stdlib.Lazy.t -> ?json_out:string option -> unit -> 'a
val default : t
val set : t -> t options_fun
val setk : (t -> 'a) -> t -> 'a options_fun
val r : t Stdlib.ref
val update : ?noop:_ -> unit options_fun
val init : ?noop:_ -> unit options_fun

Sets the options, reading the environment to get default values when unspecified

val opamroot : ?root_dir:OpamTypes.dirname -> unit -> OpamTypes.dirname

Get the initial opam root value (from default, env or optional argument). This allows to get it before doing the init, which is useful to get the configuration file used to fill some options to init()

Loads the global configuration file, protecting against concurrent writes

val write : OpamTypes.dirname -> OpamFile.Config.t -> unit

Writes the global configuration file, protecting against concurrent reads

val filter_deps : ?dev:bool -> OpamTypes.ext_formula -> OpamTypes.formula

Filters flagged dependencies in an ext_formula using the currently set options (doc, test). Build dependencies are included

val load_defaults : OpamFilename.Dir.t -> bool

Loads the config file from the OPAM root and updates default values for all related OpamXxxConfig modules. Doesn't read the env yet, the init functions should still be called afterwards. OpamFormat should be initialised beforehand, as it may impact the config file loading.

Returns true if a config file was found and could be read, false otherwise

OCaml

Innovation. Community. Security.