package opam-lib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Common types used by other modules

type 'a success = [
  1. | `Successful of 'a
]

Error and continuation handling

type 'a error = [
  1. | `Error of 'a
  2. | `Exception of exn
]
type ('a, 'b) status = [
  1. | 'a success
  2. | 'b error
]

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 =
  1. | D of dirname
  2. | F of filename

Generalized file type

type 'a download =
  1. | Up_to_date of 'a
  2. | Not_available of string
  3. | Result of 'a

Download result

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 variable_contents = OpamVariable.variable_contents =
  1. | B of bool
  2. | S of string

Content of user-defined variables

A map from variables to their contents (i.e an environment)

type package_flag =
  1. | Pkgflag_LightUninstall
    (*

    The package doesn't require downloading to uninstall

    *)
  2. | Pkgflag_AllSwitches
    (*

    The package is pervasive on all switches

    *)
  3. | Pkgflag_Verbose
    (*

    The package's scripts output is to be displayed to the user

    *)
  4. | Pkgflag_Plugin
    (*

    The package is an opam plugin that will install a opam-<name> exec, and may be auto-installed when doing opam <name>

    *)
  5. | Pkgflag_Unknown of string
    (*

    Used for error reporting, otherwise ignored

    *)

Opam package flags

type package_dep_flag =
  1. | Depflag_Build
  2. | Depflag_Test
  3. | Depflag_Doc
  4. | Depflag_Dev
  5. | Depflag_Unknown of string
    (*

    Used for error reporting, otherwise ignored

    *)

Flags on dependencies

module type GenericPackage = sig ... end

At 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 =
  1. | Empty
  2. | Atom of 'a
  3. | Block of 'a generic_formula
  4. | And of 'a generic_formula * 'a generic_formula
  5. | 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

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 = [
  1. | `http
  2. | `local
  3. | `git
  4. | `darcs
  5. | `hg
]

Repository kind

type address = string * string option

Repository address

type repository_root = dirname

Repository root

type repository = {
  1. repo_root : repository_root;
  2. repo_name : repository_name;
  3. repo_kind : repository_kind;
  4. repo_address : address;
  5. repo_priority : int;
}

Repositories

Solver

type 'a atomic_action = [
  1. | `Remove of 'a
  2. | `Install of 'a
]

Used internally when computing sequences of actions

type 'a highlevel_action = [
  1. | 'a atomic_action
  2. | `Change of [ `Up | `Down ] * 'a * 'a
  3. | `Reinstall of 'a
]

Used to compact the atomic actions and display to the user in a more meaningful way

type 'a inst_action = [
  1. | `Install of 'a
  2. | `Change of 'a * 'a * [ `Up | `Down ]
]

Sub-type of highlevel_action corresponding to an installed package that changed state or version

type 'a concrete_action = [
  1. | 'a atomic_action
  2. | `Build of 'a
]

Used when applying solutions, separates build from install

type 'a action = [
  1. | 'a atomic_action
  2. | 'a highlevel_action
  3. | 'a concrete_action
]
type 'a cause =
  1. | Use of 'a list
  2. | Required_by of 'a list
  3. | Conflicts_with of 'a list
  4. | Upstream_changes
  5. | Requested
  6. | Unknown

The possible causes of an action.

type solver_result =
  1. | Nothing_to_do
  2. | OK of package action list
    (*

    List of successful actions

    *)
  3. | Aborted
  4. | No_solution
  5. | 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 =
  1. | Success of 'a
  2. | Conflicts of 'b

Solver result

type solver_criteria = [
  1. | `Default
  2. | `Upgrade
  3. | `Fixup
]
type 'a request = {
  1. criteria : solver_criteria;
  2. wish_install : 'a conjunction;
  3. wish_remove : 'a conjunction;
  4. wish_upgrade : 'a conjunction;
  5. extra_attributes : string list;
}

Solver request

type user_action =
  1. | Install of name_set
    (*

    The 'root' packages to be installed

    *)
  2. | Upgrade of package_set
    (*

    The subset of packages to upgrade

    *)
  3. | Reinstall of package_set
  4. | Depends
  5. | Init
  6. | Remove
  7. | Switch of name_set
    (*

    The 'root' packages to be installed

    *)
  8. | Import of name_set
    (*

    The 'root' packages to be installed

    *)

user request action

type universe = {
  1. u_packages : package_set;
  2. u_installed : package_set;
  3. u_available : package_set;
  4. u_depends : ext_formula package_map;
  5. u_depopts : ext_formula package_map;
  6. u_conflicts : formula package_map;
  7. u_action : user_action;
  8. u_installed_roots : package_set;
  9. u_pinned : package_set;
  10. u_dev : package_set;
    (*

    packages with a version-controlled upstream

    *)
  11. u_base : package_set;
  12. u_attrs : (string * package_set) list;
    (*

    extra CUDF attributes for the given packages

    *)
  13. u_test : bool;
    (*

    Test dependencies should be honored

    *)
  14. u_doc : bool;
    (*

    Doc dependencies should be honored

    *)
}

Solver universe

Command line arguments

type upload = {
  1. upl_opam : filename;
  2. upl_descr : filename;
  3. upl_archive : filename;
}

Upload arguments

type pin_option =
  1. | Version of version
  2. | Local of dirname
  3. | Git of address
  4. | Darcs of address
  5. | Hg of address
  6. | Http of address

Pinned packages options

type pin_kind = [
  1. | `version
  2. | `http
  3. | `git
  4. | `darcs
  5. | `hg
  6. | `local
]

Pin kind

type shell = [
  1. | `fish
  2. | `csh
  3. | `zsh
  4. | `sh
  5. | `bash
]

Shell compatibility modes

type global_config = {
  1. complete : bool;
  2. switch_eval : bool;
}

Global configuration option

type user_config = {
  1. shell : shell;
  2. ocamlinit : bool;
  3. dot_profile : filename option;
}

User configuration option

Filtered commands

type relop = OpamFormula.relop
type logop = [
  1. | `And
  2. | `Or
]
type pfxop = [
  1. | `Not
]
type filter =
  1. | FBool of bool
  2. | FString of string
  3. | FIdent of name list * variable * (string * string) option
    (*

    packages, variable name, string converter (val_if_true, val_if_false_or_undef)

    *)
  4. | FOp of filter * relop * filter
  5. | FAnd of filter * filter
  6. | FOr of filter * filter
  7. | FNot of filter
  8. | FUndef

Filter

type simple_arg =
  1. | CString of string
  2. | 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 pos = filename * int * int

Source file positions: filename, line, column

type value =
  1. | Bool of pos * bool
  2. | Int of pos * int
  3. | String of pos * string
  4. | Relop of pos * relop * value * value
  5. | Prefix_relop of pos * relop * value
  6. | Logop of pos * logop * value * value
  7. | Pfxop of pos * pfxop * value
  8. | Ident of pos * string
  9. | List of pos * value list
  10. | Group of pos * value list
  11. | Option of pos * value * value list
  12. | Env_binding of pos * string * value * value

Base values

type file_section = {
  1. section_kind : string;
  2. section_name : string;
  3. section_items : file_item list;
}

A file section

and file_item =
  1. | Section of pos * file_section
  2. | Variable of pos * string * value

A file is composed of sections and variable definitions

type file = {
  1. file_contents : file_item list;
  2. file_name : string;
  3. 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 =
  1. | Read_lock of unit -> unit
  2. | Global_lock of unit -> unit
  3. | Switch_lock of unit -> switch * unit -> unit
  4. | Global_with_switch_cont_lock of unit -> switch * (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 = {
  1. c : 'a;
    (*

    Contents

    *)
  2. optional : bool;
    (*

    Is the contents optional

    *)
}

Optional contents

type stats = {
  1. s_install : int;
  2. s_reinstall : int;
  3. s_upgrade : int;
  4. s_downgrade : int;
  5. s_remove : int;
}

Upgrade statistics

type env = (string * string) list

Environement variables

type env_updates = (string * string * string) list

Environment updates

Repository and global states

type checksums = string list

Checksums

type json = OpamJson.t

JSON

type 'a updates = {
  1. created : 'a;
  2. updated : 'a;
  3. deleted : 'a;
  4. changed : 'a;
}

Updates

OCaml

Innovation. Community. Security.