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
|
|
|
|
2022-08-05 22:55:54 +02: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)
|
2021-02-16 16:49:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2021-05-02 11:10:25 +02:00
|
|
|
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
|
2021-02-16 16:49:38 +01:00
|
|
|
RepoUpgrades(bool) ([]Upgrade, error)
|
2021-08-02 20:42:36 +02:00
|
|
|
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
|
|
|
|
}
|