Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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.
var ( ErrInvalidControlFormat = errors.New("invalid control file format") ErrMissingRequiredField = errors.New("required field not found in control file") )
Sentinel errors for control file parsing.
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.
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 ControlFile ¶
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.
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.