alp

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

README

Alp

A package to load and inspect Arch Linux packages and modify Arch Linux package databases (with no dependency on libalpm).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownCompression = errors.New("unknown compression format")
View Source
var MagicBZ = [...]byte{0x42, 0x5a, 0x68}
View Source
var MagicGZ = [...]byte{0x1f, 0x8b}
View Source
var MagicXZ = [...]byte{0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00}
View Source
var MagicZST = [...]byte{0x28, 0xb5, 0x2f, 0xfd}

Functions

func NewCompressionWriter

func NewCompressionWriter(compression Compression, dest io.Writer) (io.WriteCloser, error)

Types

type Compression

type Compression int
const (
	CompressionGZ Compression = iota
	CompressionBZ
	CompressionXZ
	CompressionZST
)

func DetectCompressionFormat

func DetectCompressionFormat(source io.Reader) (io.Reader, Compression, error)

func NewDetectedCompressionReader

func NewDetectedCompressionReader(source io.Reader) (io.Reader, io.ReadCloser, Compression, error)

func (*Compression) CompressionFileExtension

func (cmp *Compression) CompressionFileExtension() string

func (*Compression) MarshalText

func (cmp *Compression) MarshalText() ([]byte, error)

func (*Compression) UnmarshalText

func (cmp *Compression) UnmarshalText(text []byte) error

type Database

type Database struct {
	Packages []*Package
}

func ReadDatabase

func ReadDatabase(mainDBSource io.Reader, fileDBSource io.Reader) (*Database, error)

func (*Database) Add

func (db *Database) Add(pkg *Package, replaceIfExists bool) error

func (*Database) Find

func (db *Database) Find(name string, version string) (*Package, error)

func (*Database) FindAll

func (db *Database) FindAll(name string) []*Package

func (*Database) Remove

func (db *Database) Remove(name string, version string) error

func (*Database) RemoveAll

func (db *Database) RemoveAll(name string)

func (*Database) Write

func (db *Database) Write(mainDBDest io.Writer, fileDBDest io.Writer, compression Compression) error

type Package

type Package struct {
	Name            string
	Base            string
	Version         string
	Description     string
	URL             *url.URL
	BuildDate       time.Time
	Packager        string
	Size            uint64
	CompressedSize  uint64
	Architecture    string
	Licenses        []string
	Filenames       []string
	Groups          []string
	Depends         []string
	Replaces        []string
	Conflicts       []string
	Provides        []string
	OptionalDepends []string
	MakeDepends     []string
	CheckDepends    []string
	MD5             []byte
	SHA256          []byte
	Signature       []byte
	Compression     Compression
}

func ReadPackage

func ReadPackage(source io.Reader, compressed bool) (*Package, error)

func (*Package) RepositoryFilename

func (pkg *Package) RepositoryFilename() string

Jump to

Keyboard shortcuts

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