Documentation
¶
Overview ¶
Package pkgfile extracts files from Debian and RPM packages.
This is deliberately not a package manager: it reads the payload archive and nothing else. No control metadata is parsed, no dependencies are resolved, no scripts are considered. The only use case is harvesting files that live at a well-known path inside a package, such as the CA certificates in ca-certificates.deb.
Payloads compressed with xz are rejected rather than decompressed: a pure-Go xz decoder is not in the standard library, and the core img tool deliberately takes no dependency beyond go-containerregistry and the stdlib.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
// Path is the file's path inside the package, without a leading "/".
Path string
// Content is the file's bytes.
Content []byte
}
Entry is one extracted regular file.
func ExtractDeb ¶
ExtractDeb returns the files of a .deb package's data archive that match.
A .deb is an ar archive holding, in order, debian-binary, control.tar* and data.tar*. Only the data member is read.
func ExtractRPM ¶
ExtractRPM returns the files of an .rpm package's payload that match.
The layout read here is: a 96-byte lead, the signature header (padded to an 8-byte boundary), the main header, and then the compressed cpio payload. Only the payload compressor is read out of the header; nothing else about the package is interpreted.
type ErrUnsupportedCompression ¶
type ErrUnsupportedCompression struct {
// Package is the path of the package file.
Package string
// Compression names the format, e.g. "xz".
Compression string
}
ErrUnsupportedCompression reports a payload this package cannot decompress.
func (*ErrUnsupportedCompression) Error ¶
func (e *ErrUnsupportedCompression) Error() string