codec-rpm-0.1.3: A library for manipulating RPM files

Copyright(c) 2016-2017 Red Hat Inc.
LicenseLGPL
Maintainerhttps://github.com/weldr
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Codec.RPM.Types

Description

 

Synopsis

Documentation

data RPM Source #

The top level RPM record. This contains everything in an RPM file, except for the magic value.

Constructors

RPM 

Fields

  • rpmLead :: Lead

    The Lead, an obsolete record used for identifying RPMs.

  • rpmSignatures :: [Header]

    Special Header entries that can be used to verify the integrity of an RPM. This is represented as a list because it is technically possible for there to be multiple signature headers, but in practice there is only ever one. This is the case even if multiple signatures are present. This situation will be represented by multiple Tags that can be examined to get each signature. When checking signatures, note that they only apply to the rpmHeaders and the rpmArchive.

  • rpmHeaders :: [Header]

    Header entries that contain all the metadata about an RPM. There could technically be several entries here too, but in practice there is only ever one. It is likely that each Header will contain many Tags, as RPMs tend to have a large amount of metadata.

  • rpmArchive :: ByteString

    The contents of the RPM, stored as a compressed CPIO archive.

Instances

Eq RPM Source # 

Methods

(==) :: RPM -> RPM -> Bool #

(/=) :: RPM -> RPM -> Bool #

Show RPM Source # 

Methods

showsPrec :: Int -> RPM -> ShowS #

show :: RPM -> String #

showList :: [RPM] -> ShowS #

Pretty RPM Source # 

data Lead Source #

Following the magic value that identifies a data stream as an RPM, the Lead is the very first part of the file. Due to its small size and inflexibility, it is largely obsolete and its use is discouraged even inside of the RPM library. It is generally only used as additional help beyond the magic value in verifying something is an RPM. The lead is only exposed here for completeness.

Constructors

Lead 

Fields

  • rpmMajor :: Word8

    The major version number of this RPM, for instance 0x03 for version 3.x.

  • rpmMinor :: Word8

    The minor version number of this RPM, for instance 0x00 for version 3.0.

  • rpmType :: Word16

    Is this a binary package (0x0000) or a source package (0x0001)? Other types may be defined in the future.

  • rpmArchNum :: Word16

    What platform was this package built for? x86 is 0x0001. Many other values are defined. See /usr/lib/rpm/rpmrc for the possibilities.

  • rpmName :: String

    The package name, as a NEVRA. This name is constrained to 66 bytes. Shorter names are padded with nulls.

  • rpmOSNum :: Word16

    What operating system was this package built for? Linux is 0x0001. Many other values are defined. See /usr/lib/rpm/rpmrc for the possibilities.

  • rpmSigType :: Word16

    What type of signature is used in this RPM? For now, this appears to always be set to 0x0005.

Instances

data Header Source #

A Header represents a block of metadata. It is used twice in the RPM - as the representation for signatures and as the representation for regular metadata. Internally, the header is a list of tag descriptors followed by a data store. These descriptors index into the store and explain what type of thing should be found and how many things should be read.

Here, the hard work of figuring that out is already done and the results provided as a list of Tags. The raw store itself is provided for completeness, in case further processing needs to be done on the RPM. For most users, this will never be needed.

Constructors

Header 

Fields

data SectionHeader Source #

The SectionHeader is useful in parsing an RPM. It allows for figuring out where each section occurs, how large it is, and so forth. It is likely not useful for consumers of this libary. Just like with the top-level RPM record, section headers are preceeded with a magic value that is not exposed here.

Constructors

SectionHeader 

Fields