Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompleteVersion ¶
func NewCompleteVersion ¶
func NewCompleteVersion(s string) (*CompleteVersion, error)
NewCompleteVersion creates a CompleteVersion including basic version, epoch and rel from string
func (*CompleteVersion) Equal ¶
func (a *CompleteVersion) Equal(b *CompleteVersion) bool
Equal returns true if a is equal to the argument version
func (*CompleteVersion) Newer ¶
func (a *CompleteVersion) Newer(b *CompleteVersion) bool
Newer returns true if a is newer than the argument version
func (*CompleteVersion) Older ¶
func (a *CompleteVersion) Older(b *CompleteVersion) bool
Older returns true if a is older than the argument version
func (*CompleteVersion) Satisfies ¶
func (version *CompleteVersion) Satisfies(dep *Dependency) bool
Satisfies tests whether or not version fits inside the bounds specified by dep
func (*CompleteVersion) String ¶
func (c *CompleteVersion) String() string
type Dependency ¶
type Dependency struct {
Name string // dependency name
MinVer *CompleteVersion // min version
MaxVer *CompleteVersion // max version
// contains filtered or unexported fields
}
Dependency describes a dependency with min and max version, if any.
func ParseDeps ¶
func ParseDeps(deps []string) ([]*Dependency, error)
ParseDeps parses a string slice of dependencies into a slice of Dependency objects.
func (*Dependency) Restrict ¶
func (a *Dependency) Restrict(b *Dependency) *Dependency
Restrict merges two dependencies together into a new dependency where the conditions of both a and b are met
func (*Dependency) String ¶
func (dep *Dependency) String() string
type PKGBUILD ¶
type PKGBUILD struct {
Pkgnames []string
Pkgver Version // required
Pkgrel Version // required
Pkgdir string
Epoch int
Pkgbase string
Pkgdesc string
Arch []string // required
URL string
License []string // recommended
Groups []string
Depends []*Dependency
Optdepends []string
Makedepends []*Dependency
Checkdepends []*Dependency
Provides []string
Conflicts []string
Replaces []string
Backup []string
Options []string
Install string
Changelog string
Source []string
Noextract []string
Md5sums []string
Sha1sums []string
Sha224sums []string
Sha256sums []string
Sha384sums []string
Sha512sums []string
B2sums []string
Validpgpkeys []string
}
PKGBUILD is a struct describing a parsed PKGBUILD file. Required fields are:
pkgname pkgver pkgrel arch (license) - not required but recommended
parsing a PKGBUILD file without these fields will fail
func MustParseSRCINFO ¶
MustParseSRCINFO must parse the .SRCINFO given by path or it will panic
func ParseSRCINFO ¶
ParseSRCINFO parses .SRCINFO file given by path. This is a safe alternative to ParsePKGBUILD given that a .SRCINFO file is available
func ParseSRCINFOContent ¶
ParseSRCINFOContent parses a .SRCINFO formatted byte slice. This is a safe alternative to ParsePKGBUILD given that the .SRCINFO content is available
func (*PKGBUILD) BuildDepends ¶
func (p *PKGBUILD) BuildDepends() []*Dependency
BuildDepends is Depends, MakeDepends and CheckDepends combined.
func (*PKGBUILD) CompleteVersion ¶
func (p *PKGBUILD) CompleteVersion() CompleteVersion
CompleteVersion returns a Complete version struct including version, rel and epoch.
func (*PKGBUILD) IsDevel ¶
IsDevel returns true if package contains devel packages (-{bzr,git,svn,hg}) TODO: more robust check.