mirror of
https://github.com/Jguer/yay.git
synced 2024-11-07 17:47:21 +01:00
0bf4c2e502
* show new packages in upgrade form if they exist * refactor up select * remove unused graph parts * readd len * Complete upgrade graphing * Extract to upgrade pkg * remove unused dep method * remove uneeded dep * cleanup method * specify io Reader for testing * use specified input vector * fix non-active devel * test base cases * add devel test cases * add range tests * add logger struct * use logger struct in upgrade * follow golangci recommendations * update deps * update golangci
63 lines
1.5 KiB
Go
63 lines
1.5 KiB
Go
package db
|
|
|
|
import (
|
|
"time"
|
|
|
|
alpm "github.com/Jguer/go-alpm/v2"
|
|
)
|
|
|
|
type (
|
|
IPackage = alpm.IPackage
|
|
Depend = alpm.Depend
|
|
)
|
|
|
|
// 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
|
|
Base string
|
|
Repository string
|
|
LocalVersion string
|
|
RemoteVersion string
|
|
Reason alpm.PkgReason
|
|
}
|
|
|
|
type SyncUpgrade struct {
|
|
Package alpm.IPackage
|
|
LocalVersion string
|
|
Reason alpm.PkgReason
|
|
}
|
|
|
|
type Executor interface {
|
|
AlpmArchitectures() ([]string, error)
|
|
BiggestPackages() []IPackage
|
|
Cleanup()
|
|
InstalledRemotePackageNames() []string
|
|
InstalledRemotePackages() map[string]IPackage
|
|
InstalledSyncPackageNames() []string
|
|
IsCorrectVersionInstalled(string, string) bool
|
|
LastBuildTime() time.Time
|
|
LocalPackage(string) IPackage
|
|
LocalPackages() []IPackage
|
|
LocalSatisfierExists(string) bool
|
|
PackageConflicts(IPackage) []Depend
|
|
PackageDepends(IPackage) []Depend
|
|
PackageGroups(IPackage) []string
|
|
PackageOptionalDepends(IPackage) []Depend
|
|
PackageProvides(IPackage) []Depend
|
|
PackagesFromGroup(string) []IPackage
|
|
RefreshHandle() error
|
|
SyncUpgrades(enableDowngrade bool) (
|
|
map[string]SyncUpgrade, error)
|
|
Repos() []string
|
|
SatisfierFromDB(string, string) IPackage
|
|
SyncPackage(string) IPackage
|
|
SyncPackages(...string) []IPackage
|
|
SyncSatisfier(string) IPackage
|
|
SyncSatisfierExists(string) bool
|
|
}
|