deb

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidARMagic     = errors.New("invalid AR archive magic")
	ErrInvalidHeaderSize  = errors.New("invalid header size")
	ErrInvalidModTime     = errors.New("invalid modification time")
	ErrInvalidOwnerID     = errors.New("invalid owner ID")
	ErrInvalidGroupID     = errors.New("invalid group ID")
	ErrInvalidMode        = errors.New("invalid mode")
	ErrInvalidSize        = errors.New("invalid size")
	ErrARMemberTooLarge   = errors.New("AR member size exceeds maximum allowed")
	ErrInvalidARHeaderEnd = errors.New("invalid AR header ending marker")
)

Sentinel errors for AR archive parsing.

View Source
var (
	ErrInvalidControlFormat = errors.New("invalid control file format")
	ErrMissingRequiredField = errors.New("required field not found in control file")
)

Sentinel errors for control file parsing.

View Source
var (
	ErrControlArchiveNotFound   = errors.New("control archive not found in deb file (tried .gz, .xz, .zst)")
	ErrUnsupportedArchiveFormat = errors.New("unsupported control archive format")
	ErrFileNotFoundInTar        = errors.New("file not found in tar archive")
	ErrControlArchiveTooLarge   = errors.New("control archive exceeds max decompressed size")
	ErrDebFileTooLarge          = errors.New("deb file exceeds max size")
	ErrControlFileTooLarge      = errors.New("control file exceeds max size")
)

Sentinel errors for deb file parsing.

View Source
var ErrXZDictTooLarge = errors.New("xz dictionary size exceeds limit")

ErrXZDictTooLarge is returned for an xz stream declaring an oversized dictionary.

Functions

This section is empty.

Types

type ARHeader

type ARHeader struct {
	Name    string
	ModTime time.Time
	OwnerID int
	GroupID int
	Mode    int
	Size    int64
}

ARHeader represents the header of an AR archive member.

type ControlFile

type ControlFile struct {
	Fields map[string]string
}

ControlFile represents a Debian control file (RFC 822 format).

func ParseControlFile

func ParseControlFile(r io.Reader) (*ControlFile, error)

ParseControlFile parses a Debian control file in RFC 822 format Control files use field: value format with continuation lines starting with space.

func (*ControlFile) Get

func (cf *ControlFile) Get(field string) string

Get retrieves a field value.

func (*ControlFile) GetRequired

func (cf *ControlFile) GetRequired(field string) (string, error)

GetRequired retrieves a required field value.

func (*ControlFile) ParsePackage

func (cf *ControlFile) ParsePackage() (*Package, error)

ParsePackage extracts package metadata from a control file.

type DebFile

type DebFile struct {
	Package      *Package
	ControlFile  *ControlFile
	ControlTarGz []byte
}

DebFile represents a parsed .deb file.

func ParseDebFileAt added in v0.2.0

func ParseDebFileAt(r io.ReaderAt, size int64) (*DebFile, error)

ParseDebFileAt parses a .deb file by walking the AR headers with ReadAt and reading only the control archive, so memory use is independent of the package size.

type Package

type Package struct {
	Package       string
	Version       string
	Architecture  string
	Maintainer    string
	Description   string
	Depends       string
	PreDepends    string
	Recommends    string
	Suggests      string
	Conflicts     string
	Breaks        string
	Replaces      string
	Provides      string
	Section       string
	Priority      string
	Homepage      string
	Size          int64
	InstalledSize int64
	MD5sum        string
	SHA1          string
	SHA256        string
	Filename      string
	Source        string
	SourceVersion string
	Essential     bool
	MultiArch     string
	BuiltUsing    string
	Custom        map[string]string
}

Package represents a Debian package metadata.

Jump to

Keyboard shortcuts

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