Documentation ¶
Index ¶
- Constants
- Variables
- func Cmp(v1, v2 Revision) int
- func Compatible(a, b Architecture) bool
- func FilePath(u url.URL) string
- func URL(src string) *url.URL
- type Architecture
- type ChangelogEntry
- type Constraint
- type Details
- type Operator
- type Package
- func (pkg *Package) Contains(name string) bool
- func (pkg *Package) Deselect()
- func (pkg *Package) Files() (files []string)
- func (pkg *Package) Installed() bool
- func (pkg *Package) Mask()
- func (pkg *Package) Obsoletes(s *Specification) bool
- func (pkg *Package) Satisfies(s *Specification) bool
- func (pkg *Package) Select()
- func (pkg *Package) ShortSpec() *Specification
- func (pkg *Package) Specification() *Specification
- func (pkg *Package) String() string
- func (pkg *Package) Trim(details Details)
- func (pkg *Package) URL() *url.URL
- func (pkg *Package) Unmask()
- type RPMDatabase
- func (rpm RPMDatabase) Close()
- func (rpm RPMDatabase) Erase(spec []Specification) error
- func (rpm RPMDatabase) ForEach(details Details, f func(*Package) error) error
- func (rpm RPMDatabase) Host() string
- func (rpm RPMDatabase) Install(urls []url.URL) error
- func (rpm *RPMDatabase) Open(src string) error
- func (rpm *RPMDatabase) SetProxy(p net.Addr)
- func (rpm *RPMDatabase) SetVerbose(v bool)
- func (rpm RPMDatabase) String() string
- type RPMFile
- type Repository
- type Revision
- type RpmHeader
- type Source
- type Specification
- func (a *Specification) AddFilter(attr string, op Operator, filter string) *Specification
- func (a *Specification) AddRevision(op Operator, ver Revision) *Specification
- func (p *Specification) Equal(q *Specification) bool
- func (a *Specification) GetFilter(attr string) []Constraint
- func (p *Specification) IsSimple() bool
- func (s *Specification) MarshalText() ([]byte, error)
- func (a *Specification) SatisfiedBy(b *Specification) (result bool)
- func (p *Specification) Satisfies(q *Specification) bool
- func (a Specification) String() (result string)
- func (s *Specification) UnmarshalText(text []byte) error
- type Specifications
- type Target
- type YUMRepository
Constants ¶
View Source
const ( ARCH_i386 = "i386" ARCH_i486 = "i486" ARCH_i586 = "i586" ARCH_i686 = "i686" ARCH_x86_64 = "x86_64" ARCH_none = "noarch" ARCH_source = "source" ARCH_ppc = "ppc" ARCH_ppc64 = "ppc64" )
View Source
const ( RPMSENSE_ANY = 0 RPMSENSE_LESS = (1 << 1) RPMSENSE_GREATER = (1 << 2) RPMSENSE_EQUAL = (1 << 3) /* bit 4 unused */ RPMSENSE_POSTTRANS = (1 << 5) /*!< %posttrans dependency */ RPMSENSE_PREREQ = (1 << 6) /* legacy prereq dependency */ RPMSENSE_PRETRANS = (1 << 7) /*!< Pre-transaction dependency. */ RPMSENSE_INTERP = (1 << 8) /*!< Interpreter used by scriptlet. */ RPMSENSE_SCRIPT_PRE = (1 << 9) /*!< %pre dependency. */ RPMSENSE_SCRIPT_POST = (1 << 10) /*!< %post dependency. */ RPMSENSE_SCRIPT_PREUN = (1 << 11) /*!< %preun dependency. */ RPMSENSE_SCRIPT_POSTUN = (1 << 12) /*!< %postun dependency. */ RPMSENSE_SCRIPT_VERIFY = (1 << 13) /*!< %verify dependency. */ RPMSENSE_FIND_REQUIRES = (1 << 14) /*!< find-requires generated dependency. */ RPMSENSE_FIND_PROVIDES = (1 << 15) /*!< find-provides generated dependency. */ RPMSENSE_TRIGGERIN = (1 << 16) /*!< %triggerin dependency. */ RPMSENSE_TRIGGERUN = (1 << 17) /*!< %triggerun dependency. */ RPMSENSE_TRIGGERPOSTUN = (1 << 18) /*!< %triggerpostun dependency. */ RPMSENSE_MISSINGOK = (1 << 19) /*!< suggests/enhances hint. */ /* bits 20-23 unused */ RPMSENSE_RPMLIB = (1 << 24) /*!< rpmlib(feature) dependency. */ RPMSENSE_TRIGGERPREIN = (1 << 25) /*!< %triggerprein dependency. */ RPMSENSE_KEYRING = (1 << 26) /* bit 27 unused */ RPMSENSE_CONFIG = (1 << 28) )
View Source
const ( Name Details = 1 << iota Version Status Description Dependencies Files Changelog AllDetails = (1 << iota) - 1 Summary = Name | Version | Status | Description Quick = Summary Detailed = Summary | Dependencies MoreDetailed = Detailed | Files )
Variables ¶
View Source
var ( ErrNotRPM = errors.New("invalid RPM file") ErrRPMVersion = errors.New("unsupported RPM version") )
View Source
var EOF = errors.New("EOF")
View Source
var (
ErrNotYUM = errors.New("invalid YUM repository")
)
View Source
var Forward struct { Local, Remote net.Addr }
Functions ¶
func Compatible ¶
func Compatible(a, b Architecture) bool
Types ¶
type Architecture ¶
type Architecture string
func (Architecture) Accept ¶
func (target Architecture) Accept(arch Architecture) bool
true if arch can be installed on target
func (Architecture) Canon ¶
func (arch Architecture) Canon() Architecture
type Constraint ¶
type Constraint struct {
// contains filtered or unexported fields
}
type Package ¶
type Package struct { Name string `json:",omitempty" xml:"name,attr,omitempty"` Title string `json:",omitempty" xml:",omitempty"` Description string `json:",omitempty" xml:",omitempty"` Revision Revision `json:",omitempty" xml:"revision,attr,omitempty"` Arch Architecture `json:",omitempty" xml:"arch,attr,omitempty"` OS string `json:",omitempty" xml:",omitempty"` Vendor string `json:",omitempty" xml:",omitempty"` License string `json:",omitempty" xml:",omitempty"` Packager string `json:",omitempty" xml:",omitempty"` Source string `json:",omitempty" xml:",omitempty"` Category string `json:",omitempty" xml:",omitempty"` Website string `json:",omitempty" xml:",omitempty"` Installation time.Time `json:",omitempty" xml:",omitempty"` Location string `json:",omitempty" xml:",omitempty"` Size int64 Require, Provide, Conflict, Obsolete, Enhance, Suggest Specifications `json:",omitempty" xml:",omitempty"` Changelog []ChangelogEntry `json:",omitempty" xml:",omitempty"` Selected bool Masked bool Required bool // contains filtered or unexported fields }
func (*Package) Obsoletes ¶
func (pkg *Package) Obsoletes(s *Specification) bool
func (*Package) Satisfies ¶
func (pkg *Package) Satisfies(s *Specification) bool
func (*Package) ShortSpec ¶
func (pkg *Package) ShortSpec() *Specification
func (*Package) Specification ¶
func (pkg *Package) Specification() *Specification
type RPMDatabase ¶
type RPMDatabase struct {
// contains filtered or unexported fields
}
func (RPMDatabase) Close ¶
func (rpm RPMDatabase) Close()
func (RPMDatabase) Erase ¶
func (rpm RPMDatabase) Erase(spec []Specification) error
func (RPMDatabase) ForEach ¶
func (rpm RPMDatabase) ForEach(details Details, f func(*Package) error) error
func (RPMDatabase) Host ¶
func (rpm RPMDatabase) Host() string
func (*RPMDatabase) Open ¶
func (rpm *RPMDatabase) Open(src string) error
func (*RPMDatabase) SetProxy ¶
func (rpm *RPMDatabase) SetProxy(p net.Addr)
func (*RPMDatabase) SetVerbose ¶
func (rpm *RPMDatabase) SetVerbose(v bool)
func (RPMDatabase) String ¶
func (rpm RPMDatabase) String() string
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func (Repository) Close ¶
func (repo Repository) Close()
func (Repository) ForEach ¶
func (repo Repository) ForEach(details Details, f func(*Package) error) error
func (Repository) Host ¶
func (repo Repository) Host() string
func (*Repository) Open ¶
func (repo *Repository) Open(src string) error
func (Repository) String ¶
func (repo Repository) String() string
type Revision ¶
type Revision string
func NewRevision ¶
type Specification ¶
type Specification struct {
// contains filtered or unexported fields
}
func NewSpecification ¶
func NewSpecification(name string, op Operator, ver Revision) *Specification
func ParseSpecification ¶
func ParseSpecification(s string) (*Specification, error)
func (*Specification) AddFilter ¶
func (a *Specification) AddFilter(attr string, op Operator, filter string) *Specification
func (*Specification) AddRevision ¶
func (a *Specification) AddRevision(op Operator, ver Revision) *Specification
func (*Specification) Equal ¶
func (p *Specification) Equal(q *Specification) bool
func (*Specification) GetFilter ¶
func (a *Specification) GetFilter(attr string) []Constraint
func (*Specification) IsSimple ¶
func (p *Specification) IsSimple() bool
func (*Specification) MarshalText ¶
func (s *Specification) MarshalText() ([]byte, error)
func (*Specification) SatisfiedBy ¶
func (a *Specification) SatisfiedBy(b *Specification) (result bool)
func (*Specification) Satisfies ¶
func (p *Specification) Satisfies(q *Specification) bool
func (Specification) String ¶
func (a Specification) String() (result string)
func (*Specification) UnmarshalText ¶
func (s *Specification) UnmarshalText(text []byte) error
type Specifications ¶
type Specifications map[string]*Specification
func (Specifications) Append ¶
func (specs Specifications) Append(s *Specification)
type YUMRepository ¶
type YUMRepository struct {
// contains filtered or unexported fields
}
func (*YUMRepository) Close ¶
func (repo *YUMRepository) Close()
func (YUMRepository) ForEach ¶
func (repo YUMRepository) ForEach(details Details, f func(*Package) error) error
func (*YUMRepository) Open ¶
func (repo *YUMRepository) Open(src string) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.