repo

package
v0.0.0-...-cdc9c58 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 ValidArch

func ValidArch(arch string) bool

ValidArch returns true if the arch string is valid.

func ValidArchs

func ValidArchs(archs []string) bool

ValidArchs returns true if all archs in the list are valid.

func ValidRepoName

func ValidRepoName(name string) bool

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 NewRepo

func NewRepo(r *model.Repo, basePath string) *Repo

func (*Repo) Add

func (r *Repo) Add(pkgPaths []string) error

Add adds a list of packages to a repo db, moving the package files to the repo db directory if needed.

func (*Repo) ClearPath

func (r *Repo) ClearPath() error

func (*Repo) DB

func (r *Repo) DB(arch string) string

DB returns path to db archive.

func (*Repo) FilesDB

func (r *Repo) FilesDB(arch string) string

FilesDB returns path to files db archive.

func (*Repo) InitDir

func (r *Repo) InitDir() error

func (*Repo) InitEmptyDBs

func (r *Repo) InitEmptyDBs() error

InitEmptyDBs initialize empty dbs for the repo.

func (*Repo) IsNew

func (r *Repo) IsNew(name, arch string, version pkgbuild.CompleteVersion) (bool, error)

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

func (r *Repo) IsNewFilename(file string) (bool, error)

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

func (r *Repo) Obsolete(pkgs []string, arch string) ([]string, error)

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.

func (*Repo) Package

func (r *Repo) Package(name, arch string, files bool) (*model.Package, error)

Package returns a named package from the repo.

func (*Repo) Packages

func (r *Repo) Packages(arch string, files bool) ([]*model.Package, error)

Packages returns a list of all packages in the repo.

func (*Repo) Path

func (r *Repo) Path() string

func (*Repo) PathDeep

func (r *Repo) PathDeep(arch string) string

func (*Repo) Remove

func (r *Repo) Remove(pkgs []string, arch string) error

Remove removes a list of packages from the repo db.

Jump to

Keyboard shortcuts

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