Documentation ¶
Index ¶
- Variables
- func RPMEqual(i, j RPM) bool
- func RPMLessThan(i, j RPM) bool
- type Backend
- type Client
- func (yum *Client) Close() error
- func (yum *Client) FindLatestMatchingName(name, version, release string) (*Package, error)
- func (yum *Client) FindLatestMatchingRequire(requirement *Requires) (*Package, error)
- func (yum *Client) FindLatestProvider(name, version, release string) (*Package, error)
- func (yum *Client) ListPackages(name, version, release string) ([]*Package, error)
- func (yum *Client) PackageDeps(pkg *Package, maxdepth int) ([]*Package, error)
- func (yum *Client) RequiredPackages(pkg *Package, maxdepth int) ([]*Package, error)
- func (yum *Client) SetLevel(lvl logger.Level)
- type Package
- func (pkg *Package) Arch() string
- func (rpm *Package) Epoch() string
- func (rpm *Package) Flags() string
- func (pkg *Package) Group() string
- func (rpm *Package) ID() string
- func (pkg *Package) Location() string
- func (rpm *Package) Name() string
- func (rpm *Package) ProvideMatches(p RPM) bool
- func (pkg *Package) Provides() []*Provides
- func (rpm *Package) RPMFileName() string
- func (rpm *Package) RPMName() string
- func (rpm *Package) Release() string
- func (pkg *Package) Repository() *Repository
- func (pkg *Package) Requires() []*Requires
- func (rpm *Package) StandardVersion() []string
- func (pkg *Package) String() string
- func (pkg *Package) Url() string
- func (rpm *Package) Version() string
- type Packages
- type Provides
- func (rpm *Provides) Epoch() string
- func (rpm *Provides) Flags() string
- func (rpm *Provides) ID() string
- func (rpm *Provides) Name() string
- func (rpm *Provides) ProvideMatches(p RPM) bool
- func (rpm *Provides) RPMFileName() string
- func (rpm *Provides) RPMName() string
- func (rpm *Provides) Release() string
- func (rpm *Provides) StandardVersion() []string
- func (rpm *Provides) Version() string
- type RPM
- type RPMSlice
- type RepoMD
- type Repository
- type RepositorySQLiteBackend
- func (repo *RepositorySQLiteBackend) Close() error
- func (repo *RepositorySQLiteBackend) FindLatestMatchingName(name, version, release string) (*Package, error)
- func (repo *RepositorySQLiteBackend) FindLatestMatchingRequire(requirement *Requires) (*Package, error)
- func (repo *RepositorySQLiteBackend) GetLatestDB(url string) error
- func (repo *RepositorySQLiteBackend) GetPackages() []*Package
- func (repo *RepositorySQLiteBackend) HasDB() bool
- func (repo *RepositorySQLiteBackend) LoadDB() error
- func (repo *RepositorySQLiteBackend) YumDataType() string
- type RepositoryXMLBackend
- func (repo *RepositoryXMLBackend) Close() error
- func (repo *RepositoryXMLBackend) FindLatestMatchingName(name, version, release string) (*Package, error)
- func (repo *RepositoryXMLBackend) FindLatestMatchingRequire(requirement *Requires) (*Package, error)
- func (repo *RepositoryXMLBackend) GetLatestDB(url string) error
- func (repo *RepositoryXMLBackend) GetPackages() []*Package
- func (repo *RepositoryXMLBackend) HasDB() bool
- func (repo *RepositoryXMLBackend) LoadDB() error
- func (repo *RepositoryXMLBackend) YumDataType() string
- type Requires
- func (rpm *Requires) Epoch() string
- func (rpm *Requires) Flags() string
- func (rpm *Requires) ID() string
- func (rpm *Requires) Name() string
- func (rpm *Requires) ProvideMatches(p RPM) bool
- func (rpm *Requires) RPMFileName() string
- func (rpm *Requires) RPMName() string
- func (rpm *Requires) Release() string
- func (rpm *Requires) StandardVersion() []string
- func (rpm *Requires) Version() string
Constants ¶
This section is empty.
Variables ¶
var IGNORED_PACKAGES = []string{
"rpmlib(CompressedFileNames)", "/bin/sh", "rpmlib(PayloadFilesHavePrefix)",
"rpmlib(PartialHardlinkSets)",
}
List of packages to ignore for our case
Functions ¶
func RPMLessThan ¶
Types ¶
type Backend ¶
type Backend interface { // Close cleans up a backend after use Close() error // YumDataType returns the ID for the data type as used in the repomd.xml file YumDataType() string // Download the DB from server GetLatestDB(url string) error // Check whether the DB is there HasDB() bool // Load loads the DB LoadDB() error // FindLatestMatchingName locats a package by name, returns the latest available version. FindLatestMatchingName(name, version, release string) (*Package, error) // FindLatestMatchingRequire locates a package providing a given functionality. FindLatestMatchingRequire(requirement *Requires) (*Package, error) // GetPackages returns all the packages known by a YUM repository GetPackages() []*Package }
Backend queries a YUM DB repository
func NewBackend ¶
func NewBackend(backend string, repo *Repository) (Backend, error)
NewBackend returns a new backend of type "backend"
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) FindLatestMatchingName ¶
FindLatestMatchingName locates a package by name and returns the latest available version
func (*Client) FindLatestMatchingRequire ¶
FindLatestMatchingRequire locates a package providing a given functionality.
func (*Client) FindLatestProvider ¶
FindLatestProvider returns the requested package (found by "provides") or an error.
func (*Client) ListPackages ¶
ListPackages lists all packages satisfying pattern (a regexp)
func (*Client) PackageDeps ¶
PackageDeps returns all dependencies for the package (excluding the package itself) maxdepth is the maximum number of generations along which to track dependencies. if maxdepth < 0, track them all
func (*Client) RequiredPackages ¶
RequiredPackages returns the list of all required packages for pkg (including pkg itself) maxdepth is the maximum number of generations along which to track dependencies. if maxdepth < 0, track them all
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
Package represents a RPM package in a YUM repository
func NewPackage ¶
NewPackage creates a new RPM package
func (*Package) ProvideMatches ¶
func (*Package) RPMFileName ¶
func (rpm *Package) RPMFileName() string
func (*Package) Repository ¶
func (pkg *Package) Repository() *Repository
func (*Package) StandardVersion ¶
func (rpm *Package) StandardVersion() []string
type Provides ¶
type Provides struct { Package *Package // pkg is the package Provides provides for. // contains filtered or unexported fields }
Provides represents a functionality provided by a RPM package
func NewProvides ¶
func (*Provides) ProvideMatches ¶
func (*Provides) RPMFileName ¶
func (rpm *Provides) RPMFileName() string
func (*Provides) StandardVersion ¶
func (rpm *Provides) StandardVersion() []string
type Repository ¶
type Repository struct { Name string RepoUrl string RepoMdUrl string LocalRepoMdXml string CacheDir string Backends []string Backend Backend // contains filtered or unexported fields }
Repository represents a YUM repository with all associated metadata.
func NewRepository ¶
func NewRepository(name, url, cachedir string, backends []string, setupBackend, checkForUpdates bool) (*Repository, error)
NewRepository create a new Repository with name and from url.
func (*Repository) FindLatestMatchingName ¶
func (repo *Repository) FindLatestMatchingName(name, version, release string) (*Package, error)
FindLatestMatchingName locats a package by name, returns the latest available version.
func (*Repository) FindLatestMatchingRequire ¶
func (repo *Repository) FindLatestMatchingRequire(requirement *Requires) (*Package, error)
FindLatestMatchingRequire locates a package providing a given functionality.
func (*Repository) GetPackages ¶
func (repo *Repository) GetPackages() []*Package
GetPackages returns all the packages known by a YUM repository
type RepositorySQLiteBackend ¶
type RepositorySQLiteBackend struct { Name string DBNameCompr string DBName string PrimaryCompr string Primary string Repository *Repository // contains filtered or unexported fields }
RepositorySQLiteBackend is Backend querying YUM SQLite repositories
func NewRepositorySQLiteBackend ¶
func NewRepositorySQLiteBackend(repo *Repository) (*RepositorySQLiteBackend, error)
func (*RepositorySQLiteBackend) Close ¶
func (repo *RepositorySQLiteBackend) Close() error
Close cleans up a backend after use
func (*RepositorySQLiteBackend) FindLatestMatchingName ¶
func (repo *RepositorySQLiteBackend) FindLatestMatchingName(name, version, release string) (*Package, error)
FindLatestMatchingName locates a package by name, returns the latest available version.
func (*RepositorySQLiteBackend) FindLatestMatchingRequire ¶
func (repo *RepositorySQLiteBackend) FindLatestMatchingRequire(requirement *Requires) (*Package, error)
FindLatestMatchingRequire locates a package providing a given functionality.
func (*RepositorySQLiteBackend) GetLatestDB ¶
func (repo *RepositorySQLiteBackend) GetLatestDB(url string) error
Download the DB from server
func (*RepositorySQLiteBackend) GetPackages ¶
func (repo *RepositorySQLiteBackend) GetPackages() []*Package
GetPackages returns all the packages known by a YUM repository
func (*RepositorySQLiteBackend) HasDB ¶
func (repo *RepositorySQLiteBackend) HasDB() bool
Check whether the DB is there
func (*RepositorySQLiteBackend) LoadDB ¶
func (repo *RepositorySQLiteBackend) LoadDB() error
Load loads the DB
func (*RepositorySQLiteBackend) YumDataType ¶
func (repo *RepositorySQLiteBackend) YumDataType() string
YumDataType returns the ID for the data type as used in the repomd.xml file
type RepositoryXMLBackend ¶
type RepositoryXMLBackend struct { Name string Packages map[string][]*Package Provides map[string][]*Provides DBName string Primary string Repository *Repository // contains filtered or unexported fields }
RepositoryXMLBackend is a Backend querying YUM XML repositories
func NewRepositoryXMLBackend ¶
func NewRepositoryXMLBackend(repo *Repository) (*RepositoryXMLBackend, error)
func (*RepositoryXMLBackend) Close ¶
func (repo *RepositoryXMLBackend) Close() error
Close cleans up a backend after use
func (*RepositoryXMLBackend) FindLatestMatchingName ¶
func (repo *RepositoryXMLBackend) FindLatestMatchingName(name, version, release string) (*Package, error)
FindLatestMatchingName locats a package by name, returns the latest available version.
func (*RepositoryXMLBackend) FindLatestMatchingRequire ¶
func (repo *RepositoryXMLBackend) FindLatestMatchingRequire(requirement *Requires) (*Package, error)
FindLatestMatchingRequire locates a package providing a given functionality.
func (*RepositoryXMLBackend) GetLatestDB ¶
func (repo *RepositoryXMLBackend) GetLatestDB(url string) error
Download the DB from server
func (*RepositoryXMLBackend) GetPackages ¶
func (repo *RepositoryXMLBackend) GetPackages() []*Package
GetPackages returns all the packages known by a YUM repository
func (*RepositoryXMLBackend) HasDB ¶
func (repo *RepositoryXMLBackend) HasDB() bool
Check whether the DB is there
func (*RepositoryXMLBackend) LoadDB ¶
func (repo *RepositoryXMLBackend) LoadDB() error
Load loads the DB
func (*RepositoryXMLBackend) YumDataType ¶
func (repo *RepositoryXMLBackend) YumDataType() string
YumDataType returns the ID for the data type as used in the repomd.xml file
type Requires ¶
type Requires struct {
// contains filtered or unexported fields
}
Requires represents a functionality required by a RPM package
func NewRequires ¶
func (*Requires) ProvideMatches ¶
func (*Requires) RPMFileName ¶
func (rpm *Requires) RPMFileName() string
func (*Requires) StandardVersion ¶
func (rpm *Requires) StandardVersion() []string