xbpspkgdb

package module
v0.0.0-...-d4cb841 Latest Latest
Warning

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

Go to latest
Published: May 19, 2018 License: Unlicense Imports: 7 Imported by: 0

README

GoDoc

xbpspkgdb

Decoder library for xbps plists and pkgdb

Documentation

Overview

Package xbpspkgdb provides types and functions for xbps plist access

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAuto

func IsAuto(p Package) bool

IsAuto return true if the package is automatically installed

func IsManual

func IsManual(p Package) bool

IsManual return true if the package is not automatically installed

Types

type FilterFunc

type FilterFunc func(Package) bool

FilterFunc is the type of the function called by the Pkgdb.Filter* methods

func And

func And(fs ...FilterFunc) FilterFunc

And returns true if all `FilterFunc` return true

func Not

func Not(f FilterFunc) FilterFunc

Not negates another FilterFunc

func Or

func Or(fs ...FilterFunc) FilterFunc

Or returns true if any `FilterFunc` returns true

type Package

type Package struct {
	Alternatives     map[string][]string `plist:"alternatives"`
	Architecture     string              `plist:"architecture"`
	AutomaticInstall bool                `plist:"automatic-install"`
	BuildDate        string              `plist:"build-date"`
	BuildOptions     string              `plist:"build-options"`
	ConfFiles        []string            `plist:"conf_files"`
	Conflicts        []string            `plist:"conflicts"`
	FilenameSha256   string              `plist:"filename-sha256"`
	FilenameSize     int                 `plist:"filename-size"`
	Homepage         string              `plist:"homepage"`
	InstallDate      string              `plist:"install-date"`
	InstallMsg       []byte              `plist:"install-msg"`
	InstallScript    []string            `plist:"install-script"`
	InstalledSize    int                 `plist:"installed_size"`
	License          string              `plist:"license"`
	Maintainer       string              `plist:"maintainer"`
	MetafileSha256   string              `plist:"metafile-sha256"`
	Pkgver           string              `plist:"pkgver"`
	Preserve         bool                `plist:"preserve"`
	Provides         []string            `plist:"provides"`
	RemoveMsg        []byte              `plist:"remove-msg"`
	RemoveScript     []byte              `plist:"remove-script"`
	Replaces         []string            `plist:"replaces"`
	Repolock         bool                `plist:"repolock"`
	Repository       string              `plist:"repository"`
	Reverts          []string            `plist:"reverts"`
	RunDepends       []string            `plist:"run_depends"`
	ShlibProvides    []string            `plist:"shlib-provides"`
	ShlibRequires    []string            `plist:"shlib-requires"`
	ShortDesc        string              `plist:"short_desc"`
	SourceRevisions  string              `plist:"source-revisions"`
	State            string              `plist:"state"`
}

Package hold all metadata

type Pkgdb

type Pkgdb map[string]Package

Pkgdb maps a package name to its metadata

func Decode

func Decode(r io.Reader) (Pkgdb, error)

Decode parses a xbps plist stream into a `Pkgdb`

func DecodeFile

func DecodeFile(file string) (Pkgdb, error)

DecodeFile is a convenience function that parses xbps plist files

func DecodeRepoData

func DecodeRepoData(r io.Reader) (Pkgdb, error)

DecodeRepoData parses a stream of repodata

func DecodeRepoDataFile

func DecodeRepoDataFile(file string) (Pkgdb, error)

DecodeRepoDataFile is a convenience function to parse xbps repodata files

func (Pkgdb) Filter

func (p Pkgdb) Filter(f FilterFunc) Pkgdb

Filter returns a new `Pkgdb` with filtered packages

func (Pkgdb) FilterKeys

func (p Pkgdb) FilterKeys(f FilterFunc) []string

FilterKeys returns a slice of package names that match a `FilterFunc`

Jump to

Keyboard shortcuts

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