yum

package
v0.0.0-...-ae39619 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IGNORED_PACKAGES = []string{
	"rpmlib(CompressedFileNames)", "/bin/sh", "rpmlib(PayloadFilesHavePrefix)",
	"rpmlib(PartialHardlinkSets)",
}

List of packages to ignore for our case

Functions

func RPMEqual

func RPMEqual(i, j RPM) bool

func RPMLessThan

func RPMLessThan(i, j RPM) bool

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 New

func New(siteroot string) (*Client, error)

New returns a new YUM Client, rooted at siteroot.

func (*Client) Close

func (yum *Client) Close() error

Close cleans up after use

func (*Client) FindLatestMatchingName

func (yum *Client) FindLatestMatchingName(name, version, release string) (*Package, error)

FindLatestMatchingName locates a package by name and returns the latest available version

func (*Client) FindLatestMatchingRequire

func (yum *Client) FindLatestMatchingRequire(requirement *Requires) (*Package, error)

FindLatestMatchingRequire locates a package providing a given functionality.

func (*Client) FindLatestProvider

func (yum *Client) FindLatestProvider(name, version, release string) (*Package, error)

FindLatestProvider returns the requested package (found by "provides") or an error.

func (*Client) ListPackages

func (yum *Client) ListPackages(name, version, release string) ([]*Package, error)

ListPackages lists all packages satisfying pattern (a regexp)

func (*Client) PackageDeps

func (yum *Client) PackageDeps(pkg *Package, maxdepth int) ([]*Package, error)

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

func (yum *Client) RequiredPackages(pkg *Package, maxdepth int) ([]*Package, error)

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

func (*Client) SetLevel

func (yum *Client) SetLevel(lvl logger.Level)

SetLevel sets the verbosity level of Client

type Package

type Package struct {
	// contains filtered or unexported fields
}

Package represents a RPM package in a YUM repository

func NewPackage

func NewPackage(name, version, release, epoch string) *Package

NewPackage creates a new RPM package

func (*Package) Arch

func (pkg *Package) Arch() string

func (*Package) Epoch

func (rpm *Package) Epoch() string

func (*Package) Flags

func (rpm *Package) Flags() string

func (*Package) Group

func (pkg *Package) Group() string

func (*Package) ID

func (rpm *Package) ID() string

func (*Package) Location

func (pkg *Package) Location() string

func (*Package) Name

func (rpm *Package) Name() string

func (*Package) ProvideMatches

func (rpm *Package) ProvideMatches(p RPM) bool

func (*Package) Provides

func (pkg *Package) Provides() []*Provides

func (*Package) RPMFileName

func (rpm *Package) RPMFileName() string

func (*Package) RPMName

func (rpm *Package) RPMName() string

func (*Package) Release

func (rpm *Package) Release() string

func (*Package) Repository

func (pkg *Package) Repository() *Repository

func (*Package) Requires

func (pkg *Package) Requires() []*Requires

func (*Package) StandardVersion

func (rpm *Package) StandardVersion() []string

func (*Package) String

func (pkg *Package) String() string

func (*Package) Url

func (pkg *Package) Url() string

func (*Package) Version

func (rpm *Package) Version() string

type Packages

type Packages []*Package

func (Packages) Len

func (p Packages) Len() int

func (Packages) Less

func (p Packages) Less(i, j int) bool

func (Packages) Swap

func (p Packages) Swap(i, j int)

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 NewProvides(name, version, release, epoch, flags string, pkg *Package) *Provides

func (*Provides) Epoch

func (rpm *Provides) Epoch() string

func (*Provides) Flags

func (rpm *Provides) Flags() string

func (*Provides) ID

func (rpm *Provides) ID() string

func (*Provides) Name

func (rpm *Provides) Name() string

func (*Provides) ProvideMatches

func (rpm *Provides) ProvideMatches(p RPM) bool

func (*Provides) RPMFileName

func (rpm *Provides) RPMFileName() string

func (*Provides) RPMName

func (rpm *Provides) RPMName() string

func (*Provides) Release

func (rpm *Provides) Release() string

func (*Provides) StandardVersion

func (rpm *Provides) StandardVersion() []string

func (*Provides) Version

func (rpm *Provides) Version() string

type RPM

type RPM interface {
	Name() string
	Version() string
	Release() string
	Epoch() string
	Flags() string
	StandardVersion() []string

	RPMName() string
	RPMFileName() string

	// ID returns the unique identifier of this RPM
	ID() string
}

type RPMSlice

type RPMSlice []RPM

func (RPMSlice) Len

func (p RPMSlice) Len() int

func (RPMSlice) Less

func (p RPMSlice) Less(i, j int) bool

func (RPMSlice) Swap

func (p RPMSlice) Swap(i, j int)

type RepoMD

type RepoMD struct {
	Checksum  string
	Timestamp time.Time
	Location  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) Close

func (repo *Repository) Close() error

Close cleans up after use

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 NewRequires(name, version, release, epoch, flags string, pre string) *Requires

func (*Requires) Epoch

func (rpm *Requires) Epoch() string

func (*Requires) Flags

func (rpm *Requires) Flags() string

func (*Requires) ID

func (rpm *Requires) ID() string

func (*Requires) Name

func (rpm *Requires) Name() string

func (*Requires) ProvideMatches

func (rpm *Requires) ProvideMatches(p RPM) bool

func (*Requires) RPMFileName

func (rpm *Requires) RPMFileName() string

func (*Requires) RPMName

func (rpm *Requires) RPMName() string

func (*Requires) Release

func (rpm *Requires) Release() string

func (*Requires) StandardVersion

func (rpm *Requires) StandardVersion() []string

func (*Requires) Version

func (rpm *Requires) Version() string

Jump to

Keyboard shortcuts

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