package opam-client

  1. Overview
  2. Docs

Functions handling the "opam list" subcommand

type dependency_toggles = {
  1. recursive : bool;
  2. depopts : bool;
  3. build : bool;
  4. post : bool;
  5. test : bool;
  6. doc : bool;
  7. dev : bool;
}

Switches to determine what to include when querying (reverse) dependencies

val default_dependency_toggles : dependency_toggles
type pattern_selector = {
  1. case_sensitive : bool;
  2. exact : bool;
  3. glob : bool;
  4. fields : string list;
  5. ext_fields : bool;
    (*

    Match on raw strings in x-foo fields

    *)
}
val default_pattern_selector : pattern_selector
type selector =
  1. | Any
  2. | Installed
  3. | Root
  4. | Compiler
  5. | Available
  6. | Installable
  7. | Pinned
  8. | Depends_on of dependency_toggles * OpamTypes.atom list
  9. | Required_by of dependency_toggles * OpamTypes.atom list
  10. | Conflicts_with of OpamTypes.package list
  11. | Coinstallable_with of dependency_toggles * OpamTypes.package list
  12. | Solution of dependency_toggles * OpamTypes.atom list
  13. | Pattern of pattern_selector * string
  14. | Atoms of OpamTypes.atom list
  15. | Flag of OpamTypes.package_flag
  16. | Tag of string
  17. | From_repository of OpamTypes.repository_name list
  18. | Owns_file of OpamTypes.filename

Package selectors used to filter the set of packages

val filter : base:OpamTypes.package_set -> 'a OpamStateTypes.switch_state -> selector OpamFormula.formula -> OpamTypes.package_set

Applies a formula of selectors to filter the package from a given switch state

val pattern_selector : string list -> selector OpamFormula.formula

Or-filter on package patterns (NAME or NAME.VERSION)

val get_depexts : 'a OpamStateTypes.switch_state -> OpamTypes.package_set -> OpamSysPkg.Set.t

Get the aggregated active external dependencies of the given packages

val print_depexts : OpamSysPkg.Set.t -> unit

Lists the given aggregated active external dependencies of the given packages

type output_format =
  1. | Name
    (*

    Name without version

    *)
  2. | Version
    (*

    Version of the currently looked-at package

    *)
  3. | Package
    (*

    name.version

    *)
  4. | Synopsis
    (*

    One-line package description

    *)
  5. | Synopsis_or_target
    (*

    Pinning target if pinned, synopsis otherwise

    *)
  6. | Description
    (*

    The package description, excluding synopsis

    *)
  7. | Field of string
    (*

    The value of the given opam-file field

    *)
  8. | Raw_field of string
    (*

    The raw value of the given opam-file field

    *)
  9. | Installed_version
    (*

    Installed version or "--" if none

    *)
  10. | Pinning_target
    (*

    Empty string if not pinned

    *)
  11. | Source_hash
    (*

    The VC-reported ident of current version, for dev packages. Empty if not available

    *)
  12. | Raw
    (*

    The full contents of the opam file (reformatted)

    *)
  13. | All_installed_versions
    (*

    List of the installed versions in all switches with the corresponding switches in brackets

    *)
  14. | Available_versions
    (*

    List of the available versions (currently installed one in bold if color enabled)

    *)
  15. | All_versions
    (*

    List of the existing package versions (installed, installed in current switch and unavailable colored specifically if color enabled)

    *)
  16. | Repository
    (*

    The repository the package was found in (may be empty for pinned packages)

    *)
  17. | Installed_files
    (*

    The list of files that the installed package added to the system

    *)
  18. | VC_ref
    (*

    The version-control branch or tag the package url is bound to, if any

    *)
  19. | Depexts
    (*

    The external dependencies

    *)

Element of package information to be printed. Fixme: should be part of the run-time man!

val default_list_format : output_format list
val get_switch_state : 'a OpamStateTypes.global_state -> 'a OpamStateTypes.repos_state -> OpamStateTypes.unlocked OpamStateTypes.switch_state

Gets either the current switch state, if a switch is selected, or a virtual state corresponding to the configured repos

val raw_field_names : (output_format * string) list

For documentation, includes a dummy '<field>:' for the Field format. Used for the --columns argument.

val field_names : (output_format * string) list

For documentation, includes a dummy '<field>:' and '<field>' for the Field format. Used for the --field argument.

val string_of_field : ?raw:bool -> output_format -> string
val field_of_string : raw:bool -> string -> output_format
type package_listing_format = {
  1. short : bool;
  2. header : bool;
  3. columns : output_format list;
  4. all_versions : bool;
  5. wrap : [ `Wrap of string | `Truncate | `None ] option;
  6. separator : string;
  7. value_printer : [ `Normal | `Pretty | `Normalised ];
  8. order : [ `Standard | `Dependency | `Custom of OpamTypes.package -> OpamTypes.package -> int ];
}
val default_package_listing_format : package_listing_format
val display : 'a OpamStateTypes.switch_state -> package_listing_format -> OpamTypes.package_set -> unit

Outputs a list of packages as a table according to the formatting options. normalise supersedes prettify and uses a canonical way of displaying package definition file fields. prettify uses a nicer to read format for the package definition file fields.

val info : 'a OpamStateTypes.switch_state -> fields:string list -> raw:bool -> where:bool -> ?normalise:bool -> ?show_empty:bool -> ?all_versions:bool -> ?sort:bool -> OpamTypes.atom list -> unit

Display a general summary of a collection of packages.

val mini_field_printer : ?prettify:bool -> ?normalise:bool -> OpamTypes.value -> string

Prints the value of an opam field in a shortened way (with prettify -- the default -- puts lists of strings in a format that is easier to read

val string_of_formula : selector OpamFormula.formula -> string
OCaml

Innovation. Community. Security.