meta

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package meta binds together the three places a package can reside: filesystem, database, and internet. The filesystem takes first priority.

Index

Constants

This section is empty.

Variables

View Source
var ErrMultipleDB = errors.New("multiple database files found")

Functions

This section is empty.

Types

type Package

type Package struct {
	Name string

	Files    pacman.Packages
	Database *pacman.Package
	AUR      *aur.Package
}

Package binds together the three places a package can reside: filesystem, database, and internet. The filesystem takes first priority.

The packages in Files are guaranteed to be sorted, so that the most recent version is first. It is illegal for neither Files nor Database to contain a valid Package.

func (*Package) HasFiles

func (mp *Package) HasFiles() bool

HasFiles returns true when there are files for this package.

func (*Package) HasObsolete

func (mp *Package) HasObsolete() bool

HasObsolete returns true if there are obsolete files to be deleted.

func (*Package) HasPending

func (mp *Package) HasPending() bool

HasPending returns true if there are any pending changes to filesystem or database concerning this package. This has nothing to do with whether there is an upgrade available in AUR.

func (*Package) HasUpdate

func (mp *Package) HasUpdate() bool

HasUpdate returns true when there is a newer package file available that hasn't been added to the database. This includes the case where there is no database entry for this package.

func (*Package) HasUpgrade

func (mp *Package) HasUpgrade() bool

HasUpgrade returns true when there is a newer version than either file or database.

func (*Package) IsRegistered

func (mp *Package) IsRegistered() bool

IsRegistered returns true when the package registered in the database does not exist or when the package is not registered.

func (*Package) IsSynced

func (mp *Package) IsSynced() bool

IsSynced returns true when the package is completely up-to-date and there is nothing to do.

func (*Package) Obsolete

func (mp *Package) Obsolete() pacman.Packages

func (*Package) Pkg

func (mp *Package) Pkg() *pacman.Package

Package returns the newest actual package available. This disregards whatever is in the database. If there are no files, then the database package is returned.

func (*Package) PkgDepends

func (mp *Package) PkgDepends() []string

PkgDepends returns the dependencies of the package.

func (*Package) PkgMakeDepends

func (mp *Package) PkgMakeDepends() []string

PkgMakeDepends returns the make dependenciess of the package.

func (*Package) PkgName

func (mp *Package) PkgName() string

func (*Package) PkgVersion

func (mp *Package) PkgVersion() string

func (*Package) Version

func (mp *Package) Version() string

Version returns the newest actual package version available. This disregards whatever is in the database. If there are no files, then an empty string is returned.

func (*Package) VersionRegistered

func (mp *Package) VersionRegistered() string

VersionRegistered returns the version that is registered in the database.

type Packages

type Packages []*Package

func Read

func Read(h errs.Handler, dirpath, dbpath string) (Packages, error)

Read reads meta packages in dirpath and using the database at dpbath. If dbpath == "", then no database is read. This function does not recurse.

If no database can be read, the function still continues reading packages from the directory.

func ReadRepo

func ReadRepo(h errs.Handler, dirpath string) (Packages, error)

ReadRepo tries to find a database in the specified directory. In any case, it loads all files it can. If there are multiple databases, it returns (nil, ErrMultipleDB). It does not recurse.

func (Packages) Iterate

func (mps Packages) Iterate(f func(pacman.AnyPackage))

func (Packages) Len

func (mps Packages) Len() int

func (Packages) Less

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

func (Packages) Pkgs

func (mps Packages) Pkgs() pacman.Packages

func (Packages) ReadAUR

func (ps Packages) ReadAUR() error

ReadAUR updates the list of packages by reading the AUR information for them. If any packages cannot be found, *aur.NotFoundError is returned. This can be ignored:

err := ps.ReadAUR()
if err != nil && !aur.IsNotFound(err) {
    return err
}

func (Packages) Swap

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

Jump to

Keyboard shortcuts

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