Module Debian
module Format822 : sig
type stanza = (string * (loc * string)) list
type doc = stanza list
val dummy_loc : loc
val extend_loc : ('a * 'b) -> ('c * 'd) -> ('a * 'd)
exception Parse_error_822 of string * loc
exception Syntax_error of string * loc
exception Type_error of string
type name = string
type version = string
type architecture = string
type architectures = architecture list
type buildprofile = string
type vpkgname = (string * architecture option)
type multiarch = TODO: a
type source = (name * version option)
type relop = string
type constr = (relop * version)
type vpkg = (vpkgname * constr option)
type vpkglist = vpkg list
type vpkgformula = vpkg list list
type builddep = (vpkg * (bool * architecture) list * (bool * buildprofile) list)
type builddepslist = builddep list
type builddepsformula = builddep list list
type action =
| I
| R
type suite = string
type vpkgreq = (action option * vpkg * suite option)
end
module Format822_parser : sig
type token =
| FIELD of (string * (Format822.loc * string))
| CONT of (Format822.loc * string)
| BLANKLINE
| EOF
| PGPHEAD
end
module Format822_lexer : sig
end
module Packages_parser : sig
type token =
| IDENT of string
| VIDENT of string
| STRING of string
| RELOP of string
| LBRACKET
| RBRACKET
| LPAREN
| RPAREN
| LT
| GT
| COMMA
| PIPE
| EQ
| BANG
| PLUS
| MINUS
| COLON
| SLASH
| EOL
end
module Packages : sig
type package = {
name : Format822.name;
version : Format822.version;
architecture : Format822.architecture;
multiarch : Format822.multiarch;
essential : bool;
build_essential : bool;
extra_source_only : bool;
priority : string;
source : (Format822.name * Format822.version option);
depends : Format822.vpkgformula;
pre_depends : Format822.vpkgformula;
recommends : Format822.vpkgformula;
suggests : Format822.vpkgformula;
enhances : Format822.vpkgformula;
conflicts : Format822.vpkglist;
breaks : Format822.vpkglist;
replaces : Format822.vpkglist;
provides : Format822.vpkglist;
extras : (string * string) list;
}
debian package format
val default_package : package
val parse_name : (Format822.loc * Format822.architecture) -> Format822.name
val parse_version : (Format822.loc * Format822.architecture) -> Format822.version
val parse_multiarch : (Format822.loc * Format822.architecture) -> Format822.multiarch
val parse_source : (Format822.loc * Format822.architecture) -> Format822.source
val parse_vpkg : (Format822.loc * string) -> Format822.vpkg
val parse_vpkglist : (Format822.loc * Format822.architecture) -> Format822.vpkglist
val parse_vpkgformula : (Format822.loc * Format822.architecture) -> Format822.vpkgformula
val parse_binarylist : (Format822.loc * string) -> Format822.vpkglist
val assoc : string -> (string * 'a) list -> 'a
exception ParseError of string * string
exception IgnorePackage of string
val parse_s : ?opt:'a -> ?err:string -> ?multi:bool -> ('b * 'c) -> 'a -> string -> (string * ('b * 'c)) list -> 'a
val parse_string : ('a * 'b) -> 'b
val parse_int : ('a * string) -> int
val parse_e : (string * (string * ('a * 'b)) list -> 'b option) list -> (string * ('a * 'b)) list -> (string * 'b) list
val parse_bool : ('a * string) -> bool
val parse_architecture : string list -> ('a * string) -> string
val parse_package_stanza : (string * (Format822.loc * Format822.architecture)) list -> bool option -> Format822.architecture list -> (string * (string * (Format822.loc * Format822.architecture)) list -> Format822.architecture option) list -> (string * (Format822.loc * Format822.architecture)) list -> package option
val status_filter : (string * ('a * string)) list -> bool
val arch_filter : 'a list -> (string * ('b * 'a)) list -> bool
val packages_parser : string -> (string * (Format822.loc * string)) list -> 'a option -> 'a list -> Format822.deb_parser -> 'a list
val id : package -> (Format822.name * Format822.version * Format822.architecture)
val (>%) : package -> package -> int
module Set : sig
type elt = package
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : elt -> unit -> t -> unit
val fold : elt -> 'a -> 'a -> t -> 'a -> 'a
val for_all : elt -> bool -> t -> bool
val exists : elt -> bool -> t -> bool
val filter : elt -> bool -> t -> t
val partition : elt -> bool -> t -> (t * t)
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> (t * bool * t)
val find : elt -> t -> elt
val of_list : elt list -> t
end
val merge : Set.elt list -> Set.elt list -> Set.elt list
val is_installed : package -> bool
val is_on_hold : package -> bool
val default_extras : (string * 'a option) list
val input_raw : ?filter:(string * (Format822.loc * Format822.architecture)) list -> bool -> ?archs:Format822.architecture list -> ?extras:(string * (string * (Format822.loc * Format822.architecture)) list -> Format822.architecture option) list -> string list -> Set.elt list
end
module Apt : sig
module Pcre = Re_pcre
val parse_popcon : string -> (int * string * int)
type apt_req =
| Install of Format822.vpkgreq list
| Remove of Format822.vpkgreq list
| Upgrade of Format822.suite option
| DistUpgrade of Format822.suite option
val parse_req : string -> Format822.vpkgreq
val parse_pkg_req : Format822.suite option -> string -> (Format822.action option * ((string * Format822.architecture option) * Format822.constr option) * Format822.suite option)
val parse_request_apt : string -> apt_req
val parse_request_aptitude : string -> apt_req
module Pref : sig
for details on the apt_preferences format :
man apt_preferences
type pin_t =
| Release of (string * string) list
| Origin of string
| Version of string
type package_t =
| Package of string
| Star
type pin_priority_t = int
type apt_preferences = {
package : package_t;
pin : pin_t;
pin_priority : pin_priority_t;
}
end
val parse_pref_labels : string -> (string * string) list
val parse_pref_package : ('a * Format822.architecture) -> Pref.package_t
val parse_pin : ('a * string) -> Pref.pin_t
val parse_preferences_stanza : (string * ('a * Format822.architecture)) list -> Pref.apt_preferences
val preferences_parser : Format822.stanza -> 'a -> 'a list -> Format822.deb_parser -> 'a list
end
module Architecture : sig
val src_matches_arch : string -> string -> bool
check whether a source architecture string matches a host
architecture. The source architecture string may contain
architecture wildcards ("linux-any", "any-i386"), or be "any" or
"all". The host architecure is one that may be obtained by
running "dpkg-architecture -qDEB_HOST_ARCH").
val read_triplettable : ?ttfile:string option -> ?ctfile:string option -> unit -> unit
fill the lookup table mapping debian architectures to debian triplets
this function is called by src_matches_arch without supplying anything
for the optional ttfile and ctfile arguments. If they are not None,
then they can point to a file like /usr/share/dpkg/triplettable or
/usr/share/dpkg/cputable respectively.
end
module Sources : sig
type source = {
name : Format822.name;
version : Format822.version;
architecture : Format822.architecture list;
binaries : string list;
build_depends : Format822.builddepsformula;
build_depends_indep : Format822.builddepsformula;
build_conflicts : Format822.builddepslist;
build_conflicts_indep : Format822.builddepslist;
}
val default_source : source
val parse_s : ?opt:'a -> ?err:string -> ?multi:bool -> ('b * 'c) -> 'a -> string -> (string * ('b * 'c)) list -> 'a
val parse_name : (Format822.loc * Format822.architecture) -> Format822.name
val parse_version : (Format822.loc * Format822.architecture) -> Format822.version
val parse_builddepslist : (Format822.loc * Format822.architecture) -> Format822.builddepslist
val parse_builddepsformula : (Format822.loc * Format822.architecture) -> Format822.builddepsformula
val parse_architectures : string list -> (Format822.loc * string) -> Format822.architecture list
val parse_package_stanza : (string * (Format822.loc * Format822.architecture)) list -> bool option -> string list -> (string * (Format822.loc * Format822.architecture)) list -> source option
val input_raw : ?filter:(string * (Format822.loc * Format822.architecture)) list -> bool -> ?archs:string list -> string list -> source list
val sep : string
val select : string -> 'a option -> ('b * (bool * string) list * (bool * 'a) list) -> 'b option
val sources2packages : ?profiles:bool -> ?noindep:bool -> ?src:Format822.buildprofile -> Format822.architecture -> Format822.architecture -> source list -> Packages.package list
val is_source : ?src:string -> Packages.package -> bool
exception NotfoundSrc
val get_bin_packages : 'a Pervasives.ref Common.CudfAdd.Cudf_hashtbl.t -> Common.CudfAdd.Cudf_hashtbl.key -> 'a
end
module Version : sig
val equal : string -> string -> bool
Returns
true
iff the two strings define the same version. Hence,
the result may be true even when the two string differ
syntactically.
val compare : string -> string -> int
compare x y
returns 0 if x is eqivalent to y, -1 if x is smaller
than y, and 1 if x is greater than y. This is consistent with
Pervasives.compare
.
type version_analysis =
| Native of string * string * string (* epoch,upstream,binnmu *)
| NonNative of string * string * string * string (* epoch,upstream,revision,binnmu *)
result type of the analysis of a version string. The binNMU part,
if present, has been removed from the upstream (if native version)
or revision (if non-native vesion).
val decompose : string -> version_analysis
decompose a version string
val compose : version_analysis -> string
recompose a decomposed version string. For all v:
equal(v,compose(decompose v)) = true
. There may, however, be
small syntactic differences between v
and compose(decompose v)
val strip_epoch_binnmu : string -> string
return a version without its epoch and without its binNMU part
val split : string -> (string * string * string * string)
split the debian version into its components.
(epoch,upstream,revision,binnmu) = split v
v = epoch ^ ":" ^ upstream ^ "-" ^ revision ^ binnmu.
Deprecated
decompose
should be used instead.
val concat : (string * string * string * string) -> string
Deprecated
recompose
should be used instead.
val normalize : string -> string
chop the epoch and binnmu component from a version.
Deprecated
strip_epoch_binnmu
should be used instead.
end
module Debcudf : sig
type tables
abstract data type holding the conversion tables for the debcudf translation.
type options = {
extras_opt : extramap;
native : string option; (* the native architecture *)
foreign : string list; (* list of foreign architectures *)
host : string option; (* the host architecture - cross compile *)
ignore_essential : bool;
}
val default_options : options
val init_tables : ?step:int -> ?versionlist:Format822.version list -> Packages.package list -> tables
initialize the version conversion tables
val clear : tables -> unit
return the cudf version associated to a tuple (name,version).
return Not_found if there is not package or cudf version associated
to the tuple (name,version)
val get_cudf_version : tables -> (Format822.name * Format822.version) -> int
val get_real_version : tables -> (Cudf_types.pkgname * Cudf_types.version) -> Format822.version
return the real version associated to a Cudf package
val tocudf : tables -> ?options:options -> ?inst:bool -> Packages.package -> Cudf.package
tocudf tbl p
convert the a debian package representation to cudf.- Version and package name normalization.
- Adding self conflicts.
- Virtual package normalization.
- Adding priority information if avaiblable.
- Mapping APT request.
inst : set the Installed cudf field
val lltocudf : ?enc:bool -> tables -> Format822.vpkg list list -> Cudf_types.vpkgformula
convert a debian dependency list in a cudf constraints formula
val ltocudf : ?enc:bool -> tables -> Format822.vpkg list -> Cudf_types.vpkglist
convert a debian conflict list in a cudf constraints list
end
module Release : sig
type release = {
fname : string;
origin : string;
label : string;
suite : string;
version : string;
codename : string;
date : string;
architecture : string;
component : string;
notauto : bool;
autoup : bool;
description : string;
md5sums : (string * string * string) list;
sha1 : (string * string * string) list;
sha256 : (string * string * string) list;
}
The type for representing the contents of one release file
val parse_release_in : string -> IO.input -> release option
The release file may be signed, but in this case the validity of the signature is not checked!!
parse_release_in filename channel
parses the contents of a release
file of name filename
from the input channel channel
. Returns
Some(c)
when c
is the contents of the release file read from the
stream, or None
when the stream contains only whitespace.The release file may be signed, but in this case the validity of the signature is not checked!!
end
module Debutil : sig
val get_source : Packages.package -> (Format822.name * Format822.version)
val debvpkg : (string * string) -> ('a * 'b) -> ((string * string option) * (string * string) option) -> (string * (TODO: c * 'b) option)
end
module Evolution : sig
type range = TODO: a
val string_of_range : TODO: a -> string
val range : ?bottom:bool -> string list -> TODO: a list
val discriminant : ?bottom:bool -> ?highest:bool -> TODO: a -> 'b -> 'c -> string list -> 'b list -> ('a * 'a list) list
val align : string -> TODO: a -> 'a
val all_versions : ('a * 'b) list -> 'b list
val migrate : Packages.package list -> TODO: a -> ((Packages.package * 'a) * 'a) list
val extract_epochs : string list -> string list
val add_normalize : string list -> string list
val add_epochs : string list -> string list -> string list
end
module Edsp : sig
module Pcre = Re_pcre
type request = {
request : string;
install : Format822.vpkg list;
remove : Format822.vpkg list;
architecture : Format822.architecture option;
architectures : Format822.architectures;
autoremove : bool;
upgrade : bool;
distupgrade : bool;
strict_pin : bool;
preferences : string;
cmdline : string;
}
val default_request : request
val from_apt_request : Format822.architecture option -> request -> Apt.apt_req -> request
val parse_s : ?opt:'a -> ?err:string -> ?multi:bool -> ('b * 'c) -> 'a -> string -> (string * ('b * 'c)) list -> 'a
val parse_string : ('a * 'b) -> 'b
val parse_string_opt : ('a * string) -> string option
val parse_string_list : ('a * string) -> string list
val parse_int_s : ('a * string) -> string
val parse_req : (Format822.loc * string) -> Format822.vpkg list
val parse_edsp_version : ('a * string) -> string
val parse_request_stanza : (string * (Format822.loc * Format822.architecture)) list -> request
val parse_bool_s : ('a * string) -> string
val parse_installed : Format822.stanza -> string
val parse_hold : Format822.stanza -> string
val parse_apt_id : Format822.stanza -> Format822.architecture
val parse_apt_pin : Format822.stanza -> string
val parse_automatic : Format822.stanza -> string
val parse_candidate : Format822.stanza -> string
val parse_section : Format822.stanza -> Format822.architecture
val extras : (string * Format822.stanza -> Format822.architecture option) list
val packages_parser : ?request:bool -> (request * Packages.package list) -> Format822.deb_parser -> (request * Packages.package list)
val input_raw : string -> (request * Packages.package list)
val extras_tocudf : (string * (string * TODO: a)) list
val is_installed : Packages.package -> bool
val is_on_hold : Packages.package -> bool
end
module Printer : sig
val string_of_vpkg : ((string * string option) * (string * string) option) -> string
val pp_vpkg : Pervasives.out_channel -> ((string * string option) * (string * string) option) -> unit
val string_of_vpkglist : ((string * string option) * (string * string) option) list -> string
val pp_vpkglist : Pervasives.out_channel -> ((string * string option) * (string * string) option) list -> unit
val string_of_vpkgformula : ((string * string option) * (string * string) option) list list -> string
val pp_vpkgformula : Pervasives.out_channel -> ((string * string option) * (string * string) option) list list -> unit
val strinf_of_builddep : (((string * string option) * (string * string) option) * (bool * string) list * (bool * string) list) -> string
val string_of_builddepformula : (((string * string option) * (string * string) option) * (bool * string) list * (bool * string) list) list list -> string
val pp_builddepformula : Pervasives.out_channel -> (((string * string option) * (string * string) option) * (bool * string) list * (bool * string) list) list list -> unit
val string_of_builddeplist : (((string * string option) * (string * string) option) * (bool * string) list * (bool * string) list) list -> string
val pp_builddeplist : Pervasives.out_channel -> (((string * string option) * (string * string) option) * (bool * string) list * (bool * string) list) list -> unit
end