Skip to content

arlac77/rpm-codec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm License bundlejs downloads GitHub Issues Build Status Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status

rpm-codec

Encode/decode rpm lead/header(s)

== Which version of RPM is supported?

According to <> there are, well, three versions of rpm:

  1. 'THE' rpm
  2. rpm.org, a public effort starting around 2007 producing versions 4.8 to 4.10
  3. rpm v5 creating version 5

The first rpm i got my hand on was 4.4, so for now the one and only implementation is 4.4. Do not expect any newer features such as compression other than gzip (lzma, xz, ...).

RPM file format specification

RPM files are persisted in network byte order and consist of four parts.

Lead

Our lead looks like this:

magic (0-3):: Magic value for both 'file' and rpm utilities ('ED AB EE DB')

major (4):: RPM Major version ('03')

minor (5):: RPM minor version ('00')

type (6-9):: Type binary ('00 00 00 00'). Type source ('00 00 00 01') not supported yet.

deprecated (10-95):: The rest is not used any more because its format is inflexible. Content is superseded by the header. It's only use is to support non-rpm utilities such as 'file' that can identify rpms based on a magic value. (85 times '00')

Signature

Signature format is equal to header format. This lib does not support checksums because the order of the checksum field would require the complete rpm structure to be processed before streaming could continue.

Header

Supported index types:

  • NULL = 0
  • CHAR = 1
  • INT8 = 2
  • INT16 = 3
  • INT32 = 4
  • INT64 = 5
  • STRING = 6
  • BIN = 7
  • STRING_ARRAY = 8

Payload

A gzip,xz compressed cpio structure carries the rpm payload. Other compressions algorithms exist, and are supported by newer versions of 'rpm', but for now it's gzip.

API

Table of Contents

RPMHeader

decoded rpm header

Type: Object

Properties

RPMDecoder

Decodes the rpm header.

Parameters

Returns RPMHeader

defaultEntryHandler

null handler simply skips content

Parameters

contentDecoder

Decode the body part of an rpm stream

Parameters

  • result RPMHeader
  • entryHandler EntryHandler (optional, default defaultEntryHandler)

TYPE_NULL

Not Implemented

Type: number

TYPE_STRING

variable, NUL terminated

Type: number

TYPE_STRING_ARRAY

Variable, sequence of NUL terminated strings

Type: number

TYPE_I18NSTRING

Variable, sequence of NUL terminated strings

Type: number

Bibliography

[bibliography]

About

rpm-codec is a streaming rpm packer, basically the rpm version of tar-stream

Resources

License

Stars

Watchers

Forks

Packages

No packages published