2021-11-01 16:41:07 +01:00
|
|
|
package mock
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/Jguer/yay/v11/pkg/db"
|
|
|
|
|
|
|
|
"github.com/Jguer/go-alpm/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
IPackage = alpm.IPackage
|
|
|
|
Depend = alpm.Depend
|
|
|
|
Upgrade = db.Upgrade
|
|
|
|
)
|
|
|
|
|
2022-11-20 01:51:55 +01:00
|
|
|
type DBExecutor struct {
|
|
|
|
db.Executor
|
2022-12-18 21:14:41 +01:00
|
|
|
IsCorrectVersionInstalledFn func(string, string) bool
|
|
|
|
SyncPackageFn func(string) IPackage
|
|
|
|
PackagesFromGroupFn func(string) []IPackage
|
|
|
|
LocalSatisfierExistsFn func(string) bool
|
|
|
|
SyncSatisfierFn func(string) IPackage
|
2022-12-29 13:34:53 +01:00
|
|
|
AlpmArchitecturesFn func() ([]string, error)
|
2022-11-20 01:51:55 +01:00
|
|
|
}
|
2021-11-01 16:41:07 +01:00
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) AlpmArchitectures() ([]string, error) {
|
2022-12-29 13:34:53 +01:00
|
|
|
if t.AlpmArchitecturesFn != nil {
|
|
|
|
return t.AlpmArchitecturesFn()
|
|
|
|
}
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) BiggestPackages() []IPackage {
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) Cleanup() {
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) IsCorrectVersionInstalled(s, s2 string) bool {
|
|
|
|
if t.IsCorrectVersionInstalledFn != nil {
|
|
|
|
return t.IsCorrectVersionInstalledFn(s, s2)
|
2022-12-16 18:23:44 +01:00
|
|
|
}
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) LastBuildTime() time.Time {
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) LocalPackage(s string) IPackage {
|
2021-11-01 16:41:07 +01:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) LocalPackages() []IPackage {
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) LocalSatisfierExists(s string) bool {
|
|
|
|
if t.LocalSatisfierExistsFn != nil {
|
|
|
|
return t.LocalSatisfierExistsFn(s)
|
|
|
|
}
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) PackageConflicts(iPackage IPackage) []Depend {
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) PackageDepends(iPackage IPackage) []Depend {
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) PackageGroups(iPackage IPackage) []string {
|
2021-11-01 16:41:07 +01:00
|
|
|
return []string{}
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) PackageOptionalDepends(iPackage IPackage) []Depend {
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) PackageProvides(iPackage IPackage) []Depend {
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-12-18 21:14:41 +01:00
|
|
|
func (t *DBExecutor) PackagesFromGroup(s string) []IPackage {
|
|
|
|
if t.PackagesFromGroupFn != nil {
|
|
|
|
return t.PackagesFromGroupFn(s)
|
|
|
|
}
|
|
|
|
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t DBExecutor) RefreshHandle() error {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t DBExecutor) RepoUpgrades(b bool) ([]Upgrade, error) {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t DBExecutor) Repos() []string {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t DBExecutor) SatisfierFromDB(s, s2 string) IPackage {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t DBExecutor) SyncPackage(s string) IPackage {
|
2022-12-18 21:14:41 +01:00
|
|
|
if t.SyncPackageFn != nil {
|
|
|
|
return t.SyncPackageFn(s)
|
|
|
|
}
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t DBExecutor) SyncPackages(s ...string) []IPackage {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t DBExecutor) SyncSatisfier(s string) IPackage {
|
2022-12-18 21:14:41 +01:00
|
|
|
if t.SyncSatisfierFn != nil {
|
|
|
|
return t.SyncSatisfierFn(s)
|
|
|
|
}
|
2021-11-01 16:41:07 +01:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t DBExecutor) SyncSatisfierExists(s string) bool {
|
|
|
|
panic("implement me")
|
|
|
|
}
|