mirror of
https://github.com/Jguer/yay.git
synced 2025-10-07 00:14:22 -04:00
getBases now wants a slice instead of a map
The one place this function is used, the caller converts its data to a map just to getBases will accept it. Instead just allow it to take the slice to begin with.
This commit is contained in:
parent
40776fa184
commit
b1ee03a7d8
2
dep.go
2
dep.go
@ -149,7 +149,7 @@ func splitDbFromName(pkg string) (string, string) {
|
|||||||
return "", split[0]
|
return "", split[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
func getBases(pkgs map[string]*rpc.Pkg) []Base {
|
func getBases(pkgs []*rpc.Pkg) []Base {
|
||||||
basesMap := make(map[string]Base)
|
basesMap := make(map[string]Base)
|
||||||
for _, pkg := range pkgs {
|
for _, pkg := range pkgs {
|
||||||
basesMap[pkg.PackageBase] = append(basesMap[pkg.PackageBase], pkg)
|
basesMap[pkg.PackageBase] = append(basesMap[pkg.PackageBase], pkg)
|
||||||
|
8
vcs.go
8
vcs.go
@ -10,7 +10,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
gosrc "github.com/Morganamilo/go-srcinfo"
|
gosrc "github.com/Morganamilo/go-srcinfo"
|
||||||
rpc "github.com/mikkeloscar/aur"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Info contains the last commit sha of a repo
|
// Info contains the last commit sha of a repo
|
||||||
@ -26,7 +25,6 @@ type shaInfo struct {
|
|||||||
func createDevelDB() error {
|
func createDevelDB() error {
|
||||||
var mux sync.Mutex
|
var mux sync.Mutex
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
infoMap := make(map[string]*rpc.Pkg)
|
|
||||||
|
|
||||||
_, _, _, remoteNames, err := filterPackages()
|
_, _, _, remoteNames, err := filterPackages()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -38,11 +36,7 @@ func createDevelDB() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, pkg := range info {
|
bases := getBases(info)
|
||||||
infoMap[pkg.Name] = pkg
|
|
||||||
}
|
|
||||||
|
|
||||||
bases := getBases(infoMap)
|
|
||||||
toSkip := pkgbuildsToSkip(bases, sliceToStringSet(remoteNames))
|
toSkip := pkgbuildsToSkip(bases, sliceToStringSet(remoteNames))
|
||||||
downloadPkgbuilds(bases, toSkip)
|
downloadPkgbuilds(bases, toSkip)
|
||||||
srcinfos, _ := parseSrcinfoFiles(bases, false)
|
srcinfos, _ := parseSrcinfoFiles(bases, false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user