package rpmfile

  1. Overview
  2. Docs

This module has a type definition and functions that make it easy to access fields. If you want to read a package, you can use one of the backends (rpmfile_unix or rpmfile_eio).

Types

type lead = Lead.t

Package Lead section.

type header = Header.t

Package Signature/Header section.

type metadata = {
  1. lead : lead;
  2. signature : header;
  3. header : header;
}

Modules

module Lead : sig ... end
module Header : sig ... end
module Selector : sig ... end

Predicate for parsing only necessary tags.

module D : sig ... end

Collection of decoders for convert from Header.Entry.value to user type.

Access functions

exception Not_found of string

Exception for not found fields.

High-level

If the field is not found, an Not_found exception is returned.

Header fields

val name : metadata -> string
val summary' : metadata -> string list
val summary : metadata -> string
val description' : metadata -> string list
val description : metadata -> string
val build_time : metadata -> int
val build_host : metadata -> string
val size : metadata -> int
val os : metadata -> string
val license : metadata -> string
val vendor : metadata -> string
val version : metadata -> string
val release : metadata -> string
val packager : metadata -> string
val distribution : metadata -> string
val group : metadata -> string list
val url : metadata -> string
val dist_url : metadata -> string
val arch : metadata -> string
val archive_size : metadata -> int option
val payload_format : metadata -> string
val payload_compressor : metadata -> string
val payload_flags : metadata -> string
val source_rpm : metadata -> string
val filenames : metadata -> string list
val platform : metadata -> string
val provide_names : metadata -> string list
val require_names : metadata -> string list

Signature fields

val md5 : metadata -> bytes
val sha1 : metadata -> string
val payload_size : metadata -> int

Low-level

  • raises D.Error

    if decoding of the value failed.

val get_value : 'a -> ('a * 'b) list -> 'b
val get' : msg:string option -> ('a -> 'b) -> int -> (int * 'a) list -> 'b
val get_opt' : ('a -> 'b) -> 'c -> ('c * 'a) list -> 'b option
val get : ?msg:string -> 'a D.decoder -> int -> metadata -> 'a
val get_opt : 'a D.decoder -> int -> metadata -> 'a option
val get_from_signature : ?msg:string -> 'a D.decoder -> int -> metadata -> 'a
val get_opt_from_signature : 'a D.decoder -> int -> metadata -> 'a option
OCaml

Innovation. Community. Security.