package rpmfile

  1. Overview
  2. Docs

Module RpmfileSource

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 readers (rpmfile_unix or rpmfile_eio).

Types

Sourcetype lead = Lead.t

Package Lead section.

Sourcetype header = Header.t

Package Signature/Header section.

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

Modules

Sourcemodule Lead : sig ... end
Sourcemodule Header : sig ... end
Sourcemodule Selector : sig ... end

Predicate for parsing only necessary tags.

Sourcemodule D : sig ... end

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

Access functions

Sourceexception 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

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

Signature fields

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

Low-level

  • raises D.Error

    if decoding of the value failed.

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

Utilities

Sourceval is_package : string -> bool

is_package input checks that input starts with the magic bytes of RPM package format.

OCaml

Innovation. Community. Security.