Module Napkin


module Napkin: sig .. end
Normalized Abstract PacKage INformation.

Provides a common datastructure for expressing package dependency information. Readers for Debian or RPM-style metadata output a stream of package structures.



type 'a selector =
| Sel_LEQ of 'a
| Sel_GEQ of 'a
| Sel_LT of 'a
| Sel_GT of 'a
| Sel_EQ of 'a
| Sel_ANY
The type ('a, 'b) selector represents a range of versions where type 'a represents versions and 'b represents glob patterns.
val map_selector : ('a -> 'b) -> 'a selector -> 'b selector
Maps over selectors.

type ('a, 'b, 'c) versioned =
| Unit_version of ('a * 'b selector)
| Glob_pattern of 'c
A range of versions for a unit such as ocaml (>> 3.04) is represented by "ocaml", Sel_GT "3.04".

type ('a, 'b, 'c, 'd, 'e, 'f) package = {
   pk_unit : 'b; (*The name of the unit, e.g., "libc6"*)
   pk_version : 'c; (*Its version "2.3.6.ds1-8"*)
   pk_architecture : 'e; (*Its architecture "i386";*)
   pk_extra : 'a; (*Extra user-specific information*)
   pk_size : int64; (*Its packaged size, in bytes.*)
   pk_installed_size : int64; (*Its installed size, in bytes.*)
   pk_source : 'f; (*The source of this package.*)
   pk_provides : ('b, 'c, 'd) versioned list; (*A list of units provided by this package.*)
   pk_conflicts : ('b, 'c, 'd) versioned list; (*A list of versions with which this package conflicts.*)
   pk_breaks : ('b, 'c, 'd) versioned list; (*A list of versions with which this package breaks.*)
   pk_replaces : ('b, 'c, 'd) versioned list; (*A list of versions which this package replaces.*)
   pk_depends : ('b, 'c, 'd) versioned list list; (*A list of disjunctions which this package needs to run. For instance, pk_if depends is [[a;b];[c];[d;e;f]] then this package requires (a or b) and c and (d or e or f).*)
   pk_pre_depends : ('b, 'c, 'd) versioned list list; (*A list of disjunctions which this package needs to be configured.*)
   pk_suggests : ('b, 'c, 'd) versioned list list; (*A list of disjunctions which this package suggests.*)
   pk_recommends : ('b, 'c, 'd) versioned list list; (*A list of disjunctions which this package recommends.*)
   pk_enhances : ('b, 'c, 'd) versioned list list; (*A list of disjunctions which this package enhances.*)
   pk_essential : bool; (*If true, this is an essential package.*)
   pk_build_essential : bool; (*If true, this is a build-essential package.*)
}
The main datastructure used to represent packages.
type default_package = (unit, string, string, string, string, string * string) package 
type package_with_files = ((string * string) list, string, string, string, string, string * string)
package
val map : extra:('a -> 'b) ->
unit:('c -> 'd) ->
version:('e -> 'f) ->
glob:('g -> 'h) ->
architecture:('i -> 'j) ->
source:('k -> 'l) ->
('a, 'c, 'e, 'g, 'i, 'k) package ->
('b, 'd, 'f, 'h, 'j, 'l) package
val string_of_versioned : (string, string, string) versioned -> string
Returns a textual representation of a versioned range in Debian style.
val name : ('a, 'b, 'c, 'd, 'e, 'f) package -> 'b * 'c * 'e
Package names must be unique
type channel = default_package Stream.t 
Channels are streams of packages
val to_default_package : ('a, string, string, string, string, string * string) package ->
default_package
Convert a package with extras to a default package