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 ¶
View Source
var ( ErrHashPageDuplicate error = unknownPageType(HashPageTypeDuplicate) ErrHashPageOffDup error = unknownPageType(HashPageTypeOffDup) ErrHashPageBlob error = unknownPageType(HashPageTypeBlob) )
Sentinel errors for unimplemented parts:
Functions ¶
func CheckMagic ¶
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 HashPageType ¶ added in v1.5.49
type HashPageType byte
HashPageType is the type of an internal hash page.
const ( HashPageTypeInvalid HashPageType = iota HashPageTypeKeyData HashPageTypeDuplicate HashPageTypeOffpage HashPageTypeOffDup HashPageTypeBlob )
Hash Page Types
func (HashPageType) String ¶ added in v1.5.49
func (i HashPageType) String() string
type PackageDB ¶
type PackageDB struct {
// contains filtered or unexported fields
}
PackageDB is the "pkgdb" a.k.a. "Packages", the raw package data.
type PageType ¶ added in v1.5.49
type PageType byte
PageType is the type of a page.
This is always at offset 25 (0x19) of a page.
const ( PageTypeInvalid PageType = iota // P_INVALID // Deprecated: Deprecated in version 3.1. PageTypeDuplicate // P_DUPLICATE PageTypeHashUnsorted // P_HASH_UNSORTED PageTypeBtreeInternal // P_IBTREE PageTypeRecnoInternal // P_IRECNO PageTypeBtreeLeaf // P_LBTREE PageTypeRecnoLeaf // P_LRECNO PageTypeOverflow // P_OVERFLOW PageTypeHashMeta // P_HASHMETA PageTypeBtreeMeta // P_BTREEMETA PageTypeQamMeta // P_QAMMETA PageTypeQamData // P_QAMDATA PageTypeDupLeaf // P_LDUP PageTypeHash // P_HASH PageTypeHeapMeta // P_HEAPMETA PageTypeHeap // P_HEAP PageTypeHeapInternal // P_IHEAP )
Page Types
Click to show internal directories.
Click to hide internal directories.