mirror of
https://github.com/Jguer/yay
synced 2024-10-02 22:33:47 +00:00
Make aurInfo return a pointer
This commit is contained in:
parent
f1fd4a1203
commit
074ea4465a
|
@ -397,10 +397,7 @@ func depTreeRecursive(dt *depTree, localDb *alpm.Db, syncDb alpm.DbList, isMake
|
|||
|
||||
// Cache the results
|
||||
for _, pkg := range info {
|
||||
// Copying to p fixes a bug.
|
||||
// Would rather not copy but cant find another way to fix.
|
||||
p := pkg
|
||||
dt.Aur[pkg.Name] = &p
|
||||
dt.Aur[pkg.Name] = pkg
|
||||
|
||||
}
|
||||
|
||||
|
|
13
query.go
13
query.go
|
@ -137,7 +137,7 @@ func syncSearch(pkgS []string) (err error) {
|
|||
|
||||
// SyncInfo serves as a pacman -Si for repo packages and AUR packages.
|
||||
func syncInfo(pkgS []string) (err error) {
|
||||
var info []rpc.Pkg
|
||||
var info []*rpc.Pkg
|
||||
aurS, repoS, err := packageSlices(pkgS)
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -170,7 +170,7 @@ func syncInfo(pkgS []string) (err error) {
|
|||
|
||||
if len(aurS) != 0 {
|
||||
for _, pkg := range info {
|
||||
PrintInfo(&pkg)
|
||||
PrintInfo(pkg)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -336,8 +336,8 @@ func statistics() (info struct {
|
|||
// of packages exceeds the number set in config.RequestSplitN.
|
||||
// If the number does exceed config.RequestSplitN multiple rpc requests will be
|
||||
// performed concurrently.
|
||||
func aurInfo(names []string) ([]rpc.Pkg, error) {
|
||||
info := make([]rpc.Pkg, 0, len(names))
|
||||
func aurInfo(names []string) ([]*rpc.Pkg, error) {
|
||||
info := make([]*rpc.Pkg, 0, len(names))
|
||||
seen := make(map[string]int)
|
||||
var mux sync.Mutex
|
||||
var wg sync.WaitGroup
|
||||
|
@ -358,7 +358,10 @@ func aurInfo(names []string) ([]rpc.Pkg, error) {
|
|||
return
|
||||
}
|
||||
mux.Lock()
|
||||
info = append(info, tempInfo...)
|
||||
for _, _i := range tempInfo {
|
||||
i := _i
|
||||
info = append(info, &i)
|
||||
}
|
||||
mux.Unlock()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue