2022-12-16 18:23:44 +01:00
|
|
|
package vcs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-01-24 00:03:32 +01:00
|
|
|
"github.com/Jguer/go-alpm/v2"
|
2022-12-16 18:23:44 +01:00
|
|
|
gosrc "github.com/Morganamilo/go-srcinfo"
|
|
|
|
)
|
|
|
|
|
2022-12-18 17:37:15 +01:00
|
|
|
type Mock struct {
|
|
|
|
OriginsByPackage map[string]OriginInfoByURL
|
|
|
|
ToUpgradeReturn []string
|
|
|
|
}
|
|
|
|
|
2023-01-24 00:03:32 +01:00
|
|
|
func (m *Mock) ToUpgrade(ctx context.Context, pkgName string) bool {
|
|
|
|
for _, pkg := range m.ToUpgradeReturn {
|
|
|
|
if pkg == pkgName {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
2022-12-18 17:37:15 +01:00
|
|
|
}
|
2022-12-16 18:23:44 +01:00
|
|
|
|
2022-12-18 17:37:15 +01:00
|
|
|
func (m *Mock) Update(ctx context.Context, pkgName string, sources []gosrc.ArchString) {
|
2022-12-16 18:23:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Mock) Save() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-01-24 00:03:32 +01:00
|
|
|
func (m *Mock) RemovePackages(pkgs []string) {
|
2022-12-16 18:23:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Mock) Load() error {
|
|
|
|
return nil
|
|
|
|
}
|
2023-01-24 00:03:32 +01:00
|
|
|
|
|
|
|
func (m *Mock) CleanOrphans(pkgs map[string]alpm.IPackage) {
|
|
|
|
}
|