Documentation ¶
Index ¶
- Variables
- func LoadRepoStorage() error
- func ValidArch(arch string) bool
- func ValidArchs(archs []string) bool
- func ValidRepoName(name string) bool
- type Repo
- func (r *Repo) Add(pkgPaths []string) error
- func (r *Repo) ClearPath() error
- func (r *Repo) DB(arch string) string
- func (r *Repo) FilesDB(arch string) string
- func (r *Repo) InitDir() error
- func (r *Repo) InitEmptyDBs() error
- func (r *Repo) IsNew(name, arch string, version pkgbuild.CompleteVersion) (bool, error)
- func (r *Repo) IsNewFilename(file string) (bool, error)
- func (r *Repo) Obsolete(pkgs []string, arch string) ([]string, error)
- func (r *Repo) Package(name, arch string, files bool) (*model.Package, error)
- func (r *Repo) Packages(arch string, files bool) ([]*model.Package, error)
- func (r *Repo) Path() string
- func (r *Repo) PathDeep(arch string) string
- func (r *Repo) Remove(pkgs []string, arch string) error
Constants ¶
This section is empty.
Variables ¶
var RepoStorage = ""
RepoStorage defines the repo storage basepath.
Functions ¶
func LoadRepoStorage ¶
func LoadRepoStorage() error
LoadRepoStorage checks if the path set by REPO_STORAGE is available and tries to create it if it doesn't exist.
func ValidArchs ¶
ValidArchs returns true if all archs in the list are valid.
func ValidRepoName ¶
ValidRepoName returns true if the name is a valid repo name. A valid name must only consist of lowercase alphanumerics and any of the following characters: @,.,_,+,-, and it must start with an alphanumeric.
Types ¶
type Repo ¶
type Repo struct { *model.Repo Archs []string // TODO: move to model.Repo // contains filtered or unexported fields }
Repo is a wrapper around the arch tools 'repo-add' and 'repo-remove'.
func (*Repo) Add ¶
Add adds a list of packages to a repo db, moving the package files to the repo db directory if needed.
func (*Repo) InitEmptyDBs ¶
InitEmptyDBs initialize empty dbs for the repo.
func (*Repo) IsNew ¶
IsNew returns true if pkg is a newer version than what's in the repo. If the package is not found in the repo, it will be marked as new.
func (*Repo) IsNewFilename ¶
IsNewFilename returns true if pkgfile is a newer version than what's in the repo. If the package is not found in the repo, it will be marked as new.
func (*Repo) Obsolete ¶
Obsolete returns a list of obsolete packages based on the input packages. A package is considered obsolete if it's not in the input list and not a dependency of one of the input packages.