Module OpamTypes
Definitions of many types used throughout
type 'a error=[|`Error of 'a|`Exception of exn]type ('a, 'b) status=[|'a success|'b error]
Untyped generic file format
include module type of sig ... end
type relop=[|`Eq|`Geq|`Gt|`Leq|`Lt|`Neq]type logop=[|`And|`Or]type pfxop=[|`Defined|`Not]type file_name= stringtype pos= file_name * int * inttype env_update_op= OpamParserTypes.env_update_op=|Eq|PlusEq|EqPlus|ColonEq|EqColon|EqPlusEqtype value= OpamParserTypes.value=|Bool of pos * bool|Int of pos * int|String of pos * string|Relop of pos * relop * value * value|Prefix_relop of pos * relop * value|Logop of pos * logop * value * value|Pfxop of pos * pfxop * value|Ident of pos * string|List of pos * value list|Group of pos * value list|Option of pos * value * value list|Env_binding of pos * value * env_update_op * valuetype opamfile_section= OpamParserTypes.opamfile_section={section_kind : string;section_name : string option;section_items : opamfile_item list;}and opamfile_item= OpamParserTypes.opamfile_item=|Section of pos * opamfile_section|Variable of pos * string * valuetype opamfile= OpamParserTypes.opamfile={file_contents : opamfile_item list;file_name : file_name;}
Filenames
type basename= OpamFilename.Base.tBasenames
type dirname= OpamFilename.Dir.tDirectory names (translated to absolute)
type filename= OpamFilename.tFilenames
type filename_set= OpamFilename.Set.tSet of files
type 'a filename_map= 'a OpamFilename.Map.tMap of files
Packages
type package= private OpamPackage.t={name : OpamPackage.Name.t;version : OpamPackage.Version.t;}Packages are (
name*version) tuple
type package_set= OpamPackage.Set.tSet of packages
type 'a package_map= 'a OpamPackage.Map.tMap of packages
type name= OpamPackage.Name.tPackage names
type name_set= OpamPackage.Name.Set.tSet of package names
type 'a name_map= 'a OpamPackage.Name.Map.tMap of package names
type version= OpamPackage.Version.tPackage versions
type version_set= OpamPackage.Version.Set.tSet of package versions
type opam_version= OpamVersion.tOPAM versions
Variables
type variable= OpamVariable.tVariables
type full_variable= OpamVariable.Full.tFully qualified variables (ie. with the name of sections/sub-sections they appear in)
type variable_contents= OpamVariable.variable_contents=|B of bool|S of string|L of string listContent of user-defined variables
type variable_map= OpamVariable.variable_contents OpamVariable.Map.tA map from variables to their contents (i.e an environment)
type package_flag=Opam package flags
module type GenericPackage = sig ... endAt some point we want to abstract so that the same functions can be used over CUDF and OPAM packages
Formulas
type 'a generic_formula= 'a OpamFormula.formula=|Empty|Atom of 'a|Block of 'a generic_formula|And of 'a generic_formula * 'a generic_formula|Or of 'a generic_formula * 'a generic_formulaA generic formula
type atom= OpamFormula.atomFormula atoms
type formula= OpamFormula.tFormula over versionned packages
type 'a conjunction= 'a OpamFormula.conjunctionAND formulat
type 'a disjunction= 'a OpamFormula.disjunctionOR formulat
Repositories
type repository_name= OpamRepositoryName.tRepository names
type 'a repository_name_map= 'a OpamRepositoryName.Map.tMaps of repository names
type url= OpamUrl.ttype trust_anchors={quorum : int;fingerprints : string list;}type repository={repo_name : repository_name;repo_root : dirname;The root of opam's local mirror for this repo
repo_url : url;repo_trust : trust_anchors option;}Repositories
Variable-based filters
type filter=|FBool of bool|FString of string|FIdent of name option list * variable * (string * string) optionpackages (or None for self-ref through "_"), variable name, string converter (val_if_true, val_if_false_or_undef)
|FOp of filter * relop * filter|FAnd of filter * filter|FOr of filter * filter|FNot of filter|FDefined of filter|FUndef of filterReturned by reduce functions when the filter could not be resolved to an atom (due to undefined variables or string expansions). The argument contains the partially reduced filter, where strings may still contain expansions (and are otherwise escaped). Used both for partial evaluation, and error messaging. Not allowed as an argument to other filters
Filtered formulas (to express conditional dependencies)
These are first reduced to only the dependency-flag variables build, doc, dev, test defined in Opam formulas
type 'a filter_or_constraint=|Filter of filter|Constraint of relop * 'atype filtered_formula= (name * filter filter_or_constraint OpamFormula.formula) OpamFormula.formula
Solver
type 'a atomic_action=[|`Remove of 'a|`Install of 'a]Used internally when computing sequences of actions
type 'a highlevel_action=[|'a atomic_action|`Change of [ `Up | `Down ] * 'a * 'a|`Reinstall of 'a]Used to compact the atomic actions and display to the user in a more meaningful way
type 'a inst_action=[|`Install of 'a|`Change of [ `Up | `Down ] * 'a * 'a]Sub-type of
highlevel_actioncorresponding to an installed package that changed state or version
type 'a concrete_action=[|'a atomic_action|`Build of 'a]Used when applying solutions, separates build from install
type 'a action=[|'a atomic_action|'a highlevel_action|'a concrete_action]type 'a cause=|Use of 'a list|Required_by of 'a list|Conflicts_with of 'a list|Upstream_changes|Requested|UnknownThe possible causes of an action.
type solver_result=|Nothing_to_do|OK of package action listList of successful actions
|Aborted|No_solution|Partial_error of package action list * package action list * package action listList of successful actions, list of actions with errors, list of remaining undone actions
Solver result
type solver_criteria=[|`Default|`Upgrade|`Fixup]type 'a request={criteria : solver_criteria;wish_install : 'a conjunction;wish_remove : 'a conjunction;wish_upgrade : 'a conjunction;extra_attributes : string list;}Solver request
type universe={u_packages : package_set;u_installed : package_set;u_available : package_set;u_depends : filtered_formula package_map;u_depopts : filtered_formula package_map;u_conflicts : formula package_map;u_action : user_action;u_installed_roots : package_set;u_pinned : package_set;u_base : package_set;u_reinstall : package_set;u_attrs : (string * package_set) list;}Solver universe
Command line arguments
type pin_kind=[|`version|OpamUrl.backend]Pin kind
type shell= OpamStd.Sys.shell=|SH_sh|SH_bash|SH_zsh|SH_csh|SH_fishShell compatibility modes
Generic command-line definitions with filters
type arg= simple_arg * filter optionCommand argument
Switches
type switch= OpamSwitch.tCompiler switches
type switch_set= OpamSwitch.Set.tSet of compiler switches
type 'a switch_map= 'a OpamSwitch.Map.tMap of compile switches
type switch_selections={sel_installed : package_set;sel_roots : package_set;sel_compiler : package_set;sel_pinned : package_set;}
Misc
type lock=|Read_lock of unit -> unitThe function does not modify anything, but it needs the state not to change while it is running.
|Global_lock of unit -> unitTake the global lock, all subsequent calls to OPAM are blocked.
|Switch_lock of unit -> switch * unit -> unitTake a global read lock and a switch lock. The first function is called with the read lock, then the second function is called with the returned switch write-locked.
|Global_with_switch_cont_lock of unit -> switch * (unit -> unit)Call the function in a global lock, then relax to a switch lock and call the function it returned
The different kinds of locks
type file_attribute= OpamFilename.Attribute.tA line in urls.tx
type file_attribute_set= OpamFilename.Attribute.Set.tAll the lines in urls.txt
type stats={s_install : int;s_reinstall : int;s_upgrade : int;s_downgrade : int;s_remove : int;}Upgrade statistics
type env= (string * string * string option) listEnvironement variables: var name, value, optional comment
type env_update= string * env_update_op * string * string optionEnvironment updates
var, update_op, value, comment
type tags= OpamStd.String.Set.t OpamStd.String.SetMap.tTags
Repository and global states
type json= OpamJson.tJSON