yay/pkg/db/executor.go

52 lines
1.2 KiB
Go
Raw Normal View History

2020-07-29 01:53:25 +02:00
package db
2020-08-01 01:20:00 +02:00
import (
"time"
2020-10-01 13:38:03 +02:00
alpm "github.com/Jguer/go-alpm/v2"
2020-08-01 01:20:00 +02:00
)
2020-07-29 01:53:25 +02:00
2021-08-02 14:07:33 +02:00
type (
IPackage = alpm.IPackage
Depend = alpm.Depend
)
2021-02-16 15:27:08 +01:00
// VerCmp performs version comparison according to Pacman conventions. Return
// value is <0 if and only if v1 is older than v2.
func VerCmp(v1, v2 string) int {
return alpm.VerCmp(v1, v2)
}
type Upgrade struct {
Name string
Repository string
LocalVersion string
RemoteVersion string
Reason alpm.PkgReason
}
2020-08-16 23:41:38 +02:00
type Executor interface {
AlpmArchitectures() ([]string, error)
2021-02-16 15:27:08 +01:00
BiggestPackages() []IPackage
2020-08-16 23:41:38 +02:00
Cleanup()
IsCorrectVersionInstalled(string, string) bool
LastBuildTime() time.Time
2021-02-16 15:27:08 +01:00
LocalPackage(string) IPackage
LocalPackages() []IPackage
2020-08-16 23:41:38 +02:00
LocalSatisfierExists(string) bool
2021-02-16 15:27:08 +01:00
PackageConflicts(IPackage) []Depend
PackageDepends(IPackage) []Depend
PackageGroups(IPackage) []string
PackageOptionalDepends(IPackage) []Depend
PackageProvides(IPackage) []Depend
PackagesFromGroup(string) []IPackage
2020-08-16 23:41:38 +02:00
RefreshHandle() error
RepoUpgrades(bool) ([]Upgrade, error)
Repos() []string
SatisfierFromDB(string, string) IPackage
2021-02-16 15:27:08 +01:00
SyncPackage(string) IPackage
SyncPackages(...string) []IPackage
SyncSatisfier(string) IPackage
2020-08-16 23:41:38 +02:00
SyncSatisfierExists(string) bool
}