bdb

package
v1.5.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Package bdb provides support for read-only access to an RPM database using the BerkeleyDB "hash" format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMagic

func CheckMagic(ctx context.Context, r io.Reader) bool

CheckMagic looks at bit of the provided Reader to see if it looks like a BerkeleyDB file.

According to the libmagic database I looked at:

# Hash 1.85/1.86 databases store metadata in network byte order.
# Btree 1.85/1.86 databases store the metadata in host byte order.
# Hash and Btree 2.X and later databases store the metadata in host byte order.

Since this process can't (and doesn't want to) know the endian-ness of the layer's eventual host, we just look both ways for the one type we support.

Types

type PackageDB

type PackageDB struct {
	// contains filtered or unexported fields
}

PackageDB is the "pkgdb" a.k.a. "Packages", the raw package data.

func (*PackageDB) AllHeaders

func (db *PackageDB) AllHeaders(ctx context.Context) ([]io.ReaderAt, error)

AllHeaders returns ReaderAts for all RPM headers in the PackageDB.

func (*PackageDB) Parse

func (db *PackageDB) Parse(r io.ReaderAt) error

Parse closes over the provided io.ReaderAt and readies the provided PackageDB.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL