yay/pkg/vcs/mock.go
Jo 4626a0409c
fix(vcs): do not vcs update gather orphan info (#1902)
* reduce complexity of devel upgrade gathering

* clean orphans devel
2023-01-23 23:03:32 +00:00

40 lines
671 B
Go

package vcs
import (
"context"
"github.com/Jguer/go-alpm/v2"
gosrc "github.com/Morganamilo/go-srcinfo"
)
type Mock struct {
OriginsByPackage map[string]OriginInfoByURL
ToUpgradeReturn []string
}
func (m *Mock) ToUpgrade(ctx context.Context, pkgName string) bool {
for _, pkg := range m.ToUpgradeReturn {
if pkg == pkgName {
return true
}
}
return false
}
func (m *Mock) Update(ctx context.Context, pkgName string, sources []gosrc.ArchString) {
}
func (m *Mock) Save() error {
return nil
}
func (m *Mock) RemovePackages(pkgs []string) {
}
func (m *Mock) Load() error {
return nil
}
func (m *Mock) CleanOrphans(pkgs map[string]alpm.IPackage) {
}