Module OpamTypes

module OpamTypes: sig .. end
Common types used by other modules

exception Lexer_error of string

Exceptions



Filenames


type basename = OpamFilename.Base.t 
Basenames
type dirname = OpamFilename.Dir.t 
Directory names
type filename = OpamFilename.t 
Filenames
type filename_set = OpamFilename.Set.t 
Set of files
type 'a filename_map = 'a OpamFilename.Map.t 
Map of files
type generic_file = OpamFilename.generic_file = 
| D of dirname
| F of filename
Generalized file type
type 'a download = 
| Up_to_date of 'a
| Not_available of string
| Result of 'a
Download result
val download_dir : dirname download ->
generic_file download
Upcast a downloaded directory.
val download_file : filename download ->
generic_file download
Upcast a downloaded file.

Packages


type package = OpamPackage.t 
Packages are (name * version) tuple
type package_set = OpamPackage.Set.t 
Set of packages
type 'a package_map = 'a OpamPackage.Map.t 
Map of packages
type name = OpamPackage.Name.t 
Package names
type name_set = OpamPackage.Name.Set.t 
Set of package names
type 'a name_map = 'a OpamPackage.Name.Map.t 
Map of package names
type version = OpamPackage.Version.t 
Package versions
type version_set = OpamPackage.Version.Set.t 
Set of package versions

Compilers


type compiler = OpamCompiler.t 
Compiler names
type compiler_set = OpamCompiler.Set.t 
Set of compiler names
type 'a compiler_map = 'a OpamCompiler.Map.t 
Maps of compiler names
type compiler_version = OpamCompiler.Version.t 
Compiler versions
type opam_version = OpamVersion.t 
OPAM versions
type compiler_constraint = OpamCompiler.Version.constr 
Compiler constraints

Variables


type variable = OpamVariable.t 
Variables
type full_variable = OpamVariable.Full.t 
Fully qualified variables (ie. with the name of sections/sub-sections they appear in)
type section = OpamVariable.Section.t 
Section names
type full_section = OpamVariable.Section.Full.t 
Fully qualified section names
type variable_contents = OpamVariable.variable_contents = 
| B of bool
| S of string
Content of user-defined variables
type variable_map = OpamVariable.variable_contents OpamVariable.Map.t 
A map from variables to their contents (i.e an environment)
type ppflag = 
| Camlp4 of string list
| Cmd of string list
Content of pp variables

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_formula
A generic formula
type atom = OpamFormula.atom 
Formula atoms
type formula = OpamFormula.t 
Formula over versionned packages
type 'a conjunction = 'a OpamFormula.conjunction 
AND formulat
type 'a disjunction = 'a OpamFormula.disjunction 
OR formulat

Repositories


type repository_name = OpamRepositoryName.t 
Repository names
type 'a repository_name_map = 'a OpamRepositoryName.Map.t 
Maps of repository names
type repository_kind = [ `darcs | `git | `hg | `http | `local ] 
Repository kind
type address = string * string option 
Repository address
val string_of_address : address -> string
Print an address
val address_of_string : string -> address
Parse an address
val guess_repository_kind : repository_kind option ->
address -> repository_kind
Guess the repository kind
val string_of_repository_kind : [ `darcs | `git | `hg | `http | `local ] -> string
Pretty-print repository kinds.
val repository_kind_of_string : string -> [ `darcs | `git | `hg | `http | `local ]
Parser of repository kinds. Raise an error if the kind is not valid.
type repository_root = dirname 
Repository root
type repository = {
   repo_root : repository_root;
   repo_name : repository_name;
   repo_kind : repository_kind;
   repo_address : address;
   repo_priority : int;
}
Repositories

Solver


type 'a action = 
| To_change of 'a option * 'a
| To_delete of 'a
| To_recompile of 'a
The solver answers a list of actions to perform
type 'a cause = 
| Use of 'a list
| Required_by of 'a list
| Upstream_changes
| Unknown
The possible causes of an action.
val action_contents : 'a action -> 'a
Extract a package from a package action.
module type ACTION_GRAPH = sig .. end
Graph of package actions
module type PKG = sig .. end
Signature of packages
module MakeActionGraph: 
functor (Pkg : PKG) -> ACTION_GRAPH with type package = Pkg.t
Functor to create a graph af actions
module PackageAction: PKG  with type t = package
Package actions
module PackageActionGraph: ACTION_GRAPH  with type package = package
Graph of OPAM packages
type solution = PackageActionGraph.solution 
The type for solutions
type solver_result = 
| Nothing_to_do
| OK of package action list (*List of successful actions*)
| Aborted
| No_solution
| Error of package action list
* package action list
* package action list
(*List of successful actions, list of actions with errors, list of remaining undone actions*)
Solver result
type ('a, 'b) result = 
| Success of 'a
| Conflicts of (unit -> 'b)
Solver result
type 'a request = {
   wish_install : 'a conjunction;
   wish_remove : 'a conjunction;
   wish_upgrade : 'a conjunction;
}
Solver request
type user_action = 
| Install of name_set (*The 'root' packages to be installed*)
| Upgrade of package_set (*The subset of packages to upgrade*)
| Reinstall
| Depends
| Init of name_set (*The 'root' packages to be installed*)
| Remove
| Switch of name_set (*The 'root' packages to be installed*)
| Import of name_set (*The 'root' packages to be installed*)
user request action
type universe = {
   u_packages : package_set;
   u_installed : package_set;
   u_available : package_set;
   u_depends : formula package_map;
   u_depopts : formula package_map;
   u_conflicts : formula package_map;
   u_action : user_action;
   u_installed_roots : package_set;
   u_pinned : name_set;
}
Solver universe

Command line arguments


type upload = {
   upl_opam : filename;
   upl_descr : filename;
   upl_archive : filename;
}
Upload arguments
val string_of_upload : upload -> string
Pretty-print
type pin_option = 
| Version of version
| Local of dirname
| Git of address
| Darcs of address
| Hg of address
| Unpin
| Edit
Pinned packages options
type pin = {
   pin_package : name;
   pin_option : pin_option;
}
Pinned packages
val string_of_pin : pin -> string
Pretty-printing of pinned packages
type pin_kind = [ `darcs | `git | `hg | `local | `version ] 
Pin kind
val repository_kind_of_pin_kind : pin_kind -> repository_kind option
Convert a pin kind to a repository kind
val pin_kind_of_string : string -> pin_kind
Pretty-printing of pin kinds.
val string_of_pin_kind : pin_kind -> string
Parsing of pin kinds. Raise an error if it is not a valid value.
val pin_option_of_string : ?kind:pin_kind -> string -> pin_option
Read pin options args
val string_of_pin_option : pin_option -> string
Convert a pin option to a string
val kind_of_pin_option : pin_option -> pin_kind option
Get the pin kind from a pin option
type config = {
   conf_is_rec : bool;
   conf_is_byte : bool;
   conf_is_link : bool;
   conf_options : OpamVariable.Section.Full.t list;
}
Configuration requests
type shell = [ `bash | `csh | `fish | `sh | `zsh ] 
Shell compatibility modes
val string_of_shell : shell -> string
Pretty-print
type global_config = {
   complete : bool;
   switch_eval : bool;
}
Global configuration option
type user_config = {
   shell : shell;
   ocamlinit : bool;
   dot_profile : filename option;
}
User configuration option

Filtered commands


type symbol = 
| Eq
| Neq
| Le
| Ge
| Lt
| Gt
Symbols
val string_of_symbol : symbol -> string
Pretty print
type filter = 
| FBool of bool
| FString of string
| FIdent of string
| FOp of filter * symbol * filter
| FAnd of filter * filter
| FOr of filter * filter
| FNot of filter
Filter
val string_of_filter : filter -> string
Pretty print
type simple_arg = 
| CString of string
| CIdent of string
A command argument
type arg = simple_arg * filter option 
Command argument
type command = arg list * filter option 
Command

Untyped generic file format


type value = 
| Bool of bool
| Int of int
| String of string
| Symbol of string
| Ident of string
| List of value list
| Group of value list
| Option of value * value list
Base values
type file_section = {
   section_kind : string;
   section_name : string;
   section_items : file_item list;
}
A file section
type file_item = 
| Section of file_section
| Variable of string * value
A file is composed of sections and variable definitions
type file = {
   file_contents : file_item list;
   file_name : string;
   file_format : opam_version;
}
A file is a list of items and the filename

Switches


type switch = OpamSwitch.t 
Compiler switches
type switch_set = OpamSwitch.Set.t 
Set of compiler switches
type 'a switch_map = 'a OpamSwitch.Map.t 
Map of compile switches

Misc


type lock = 
| Read_lock of (unit -> unit)
| Global_lock of (unit -> unit)
| Switch_lock of (unit -> unit)
The different kinds of locks
type file_attribute = OpamFilename.Attribute.t 
A line in urls.tx
type file_attribute_set = OpamFilename.Attribute.Set.t 
All the lines in urls.txt
type 'a optional = {
   c : 'a; (*Contents*)
   optional : bool; (*Is the contents optional*)
}
Optional contents
type stats = {
   s_install : int;
   s_reinstall : int;
   s_upgrade : int;
   s_downgrade : int;
   s_remove : int;
}
Upgrade statistics
type env = (string * string) list 
Environement variables
type env_updates = (string * string * string) list 
Environment updates
type tags = OpamMisc.StringSet.t OpamMisc.StringSetMap.t 
Tags

Repository and global states


type checksums = string list 
Checksums
type json = OpamJson.t 

JSON


type 'a updates = {
   created : 'a;
   updated : 'a;
   deleted : 'a;
   changed : 'a;
}

Updates