Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update deps #1868

Merged
merged 2 commits into from
Dec 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clean.go
Original file line number Diff line number Diff line change
@@ -126,8 +126,8 @@ func cleanAUR(ctx context.Context, keepInstalled, keepCurrent, removeAll bool, d
return errInfo
}

for _, pkg := range info {
inAURBases.Set(pkg.PackageBase)
for i := range info {
inAURBases.Set(info[i].PackageBase)
}
}

6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/Jguer/yay/v11

require (
github.com/Jguer/aur v1.1.2
github.com/Jguer/aur v1.1.3
github.com/Jguer/go-alpm/v2 v2.1.2
github.com/Jguer/votar v1.0.0
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5
github.com/Morganamilo/go-srcinfo v1.0.0
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible
github.com/leonelquinteros/gotext v1.5.0
github.com/leonelquinteros/gotext v1.5.1
github.com/stretchr/testify v1.8.1
golang.org/x/sys v0.3.0
golang.org/x/term v0.3.0
@@ -26,7 +26,7 @@ require (

require (
github.com/deckarep/golang-set/v2 v2.1.0
github.com/itchyny/gojq v0.12.10 // indirect
github.com/itchyny/gojq v0.12.11 // indirect
github.com/itchyny/timefmt-go v0.1.5 // indirect
github.com/ohler55/ojg v1.15.0 // indirect
)
36 changes: 25 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/Jguer/aur v1.1.2 h1:PCfYLWoFRyvV3inuF/STy2Y+lU8ihxPX6tmpn64von0=
github.com/Jguer/aur v1.1.2/go.mod h1:JRMEdcTsAqsytKUNEEczeXjz+k0r7xigUZ3zx45Y6BY=
github.com/Jguer/aur v1.1.3 h1:wuqz67ZqUnyqS56WjNSwKqrZCJFeDuG+ljWnmmPKg04=
github.com/Jguer/aur v1.1.3/go.mod h1:YWXsL0qywB3kY8gduwAJwklN38opQYRm6+pYMJgtCd0=
github.com/Jguer/go-alpm/v2 v2.1.2 h1:CGTIxzuEpT9Q3a7IBrx0E6acoYoaHX2Z93UOApPDhgU=
github.com/Jguer/go-alpm/v2 v2.1.2/go.mod h1:uLQcTMNM904dRiGU+/JDtDdd7Nd8mVbEVaHjhmziT7w=
github.com/Jguer/votar v1.0.0 h1:drPYpV5Py5BeAQS8xezmT6uCEfLzotNjLf5yfmlHKTg=
@@ -21,12 +21,12 @@ github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6
github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
github.com/itchyny/gojq v0.12.10 h1:6TcS0VYWS6wgntpF/4tnrzwdCMjiTxRAxIqZWfDsDQU=
github.com/itchyny/gojq v0.12.10/go.mod h1:o3FT8Gkbg/geT4pLI0tF3hvip5F3Y/uskjRz9OYa38g=
github.com/itchyny/gojq v0.12.11 h1:YhLueoHhHiN4mkfM+3AyJV6EPcCxKZsOnYf+aVSwaQw=
github.com/itchyny/gojq v0.12.11/go.mod h1:o3FT8Gkbg/geT4pLI0tF3hvip5F3Y/uskjRz9OYa38g=
github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE=
github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8=
github.com/leonelquinteros/gotext v1.5.0 h1:ODY7LzLpZWWSJdAHnzhreOr6cwLXTAmc914FOauSkBM=
github.com/leonelquinteros/gotext v1.5.0/go.mod h1:OCiUVHuhP9LGFBQ1oAmdtNCHJCiHiQA8lf4nAifHkr0=
github.com/leonelquinteros/gotext v1.5.1 h1:vmddRn3gHp67YFjZLZE2AZsgYMT4IBTJhua4yfe7/4Q=
github.com/leonelquinteros/gotext v1.5.1/go.mod h1:/A4Y7BvIsf5JHO60E43ZQDVkV3qO+7eP8HjeqD6ChIA=
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4=
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
github.com/ohler55/ojg v1.15.0 h1:Z95FvBiMsMOOGP9Nzv5OVV4ND2KnEMxk0GOS8Kvcahg=
@@ -46,23 +46,37 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/tools v0.0.0-20200221224223-e1da425f72fd/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
8 changes: 4 additions & 4 deletions local_install_test.go
Original file line number Diff line number Diff line change
@@ -138,8 +138,8 @@ func TestIntegrationLocalInstall(t *testing.T) {
CmdBuilder: cmdBuilder,
VCSStore: &vcs.Mock{},
AURCache: &mockaur.MockAUR{
GetFn: func(ctx context.Context, query *metadata.AURQuery) ([]*aur.Pkg, error) {
return []*aur.Pkg{}, nil
GetFn: func(ctx context.Context, query *metadata.AURQuery) ([]aur.Pkg, error) {
return []aur.Pkg{}, nil
},
},
},
@@ -254,8 +254,8 @@ func TestIntegrationLocalInstallMissingDep(t *testing.T) {
CmdBuilder: cmdBuilder,
VCSStore: &vcs.Mock{},
AURCache: &mockaur.MockAUR{
GetFn: func(ctx context.Context, query *metadata.AURQuery) ([]*aur.Pkg, error) {
return []*aur.Pkg{}, nil
GetFn: func(ctx context.Context, query *metadata.AURQuery) ([]aur.Pkg, error) {
return []aur.Pkg{}, nil
},
},
},
5 changes: 3 additions & 2 deletions pkg/dep/base.go
Original file line number Diff line number Diff line change
@@ -53,9 +53,10 @@ func (b Base) String() string {
return str
}

func GetBases(pkgs []*aur.Pkg) []Base {
func GetBases(pkgs []aur.Pkg) []Base {
basesMap := make(map[string]Base)
for _, pkg := range pkgs {
for i := range pkgs {
pkg := &pkgs[i]
basesMap[pkg.PackageBase] = append(basesMap[pkg.PackageBase], pkg)
}

3 changes: 2 additions & 1 deletion pkg/dep/depPool.go
Original file line number Diff line number Diff line change
@@ -223,8 +223,9 @@ func (dp *Pool) cacheAURPackages(ctx context.Context, _pkgs stringset.StringSet,
return err
}

for _, pkg := range info {
for i := range info {
// Dump everything in cache just in case we need it later
pkg := &info[i]
dp.AurCache[pkg.Name] = pkg
}

26 changes: 13 additions & 13 deletions pkg/dep/dep_graph.go
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ var colorMap = map[Reason]string{
}

type AURCache interface {
Get(ctx context.Context, query *metadata.AURQuery) ([]*aurc.Pkg, error)
Get(ctx context.Context, query *metadata.AURQuery) ([]aurc.Pkg, error)
}

type Grapher struct {
@@ -358,9 +358,9 @@ func (g *Grapher) addNodes(
continue
}

var aurPkgs []*aur.Pkg
var aurPkgs []aur.Pkg
if cachedProvidePkg, ok := g.providerCache[depName]; ok {
aurPkgs = []*aur.Pkg{cachedProvidePkg}
aurPkgs = []aur.Pkg{*cachedProvidePkg}
} else {
var errMeta error
aurPkgs, errMeta = g.aurCache.Get(ctx,
@@ -377,8 +377,8 @@ func (g *Grapher) addNodes(
if len(aurPkgs) != 0 { // Check AUR
pkg := aurPkgs[0]
if len(aurPkgs) > 1 {
pkg = provideMenu(g.w, depName, aurPkgs, g.noConfirm)
g.providerCache[depName] = pkg
chosen := provideMenu(g.w, depName, aurPkgs, g.noConfirm)
g.providerCache[depName] = chosen
}

if err := graph.DependOn(pkg.Name, parentPkgName); err != nil {
@@ -397,7 +397,7 @@ func (g *Grapher) addNodes(
Version: pkg.Version,
},
})
g.addDepNodes(ctx, pkg, graph)
g.addDepNodes(ctx, &pkg, graph)

continue
}
@@ -416,10 +416,10 @@ func (g *Grapher) addNodes(
}
}

func provideMenu(w io.Writer, dep string, options []*aur.Pkg, noConfirm bool) *aur.Pkg {
func provideMenu(w io.Writer, dep string, options []aur.Pkg, noConfirm bool) *aur.Pkg {
size := len(options)
if size == 1 {
return options[0]
return &options[0]
}

str := text.Bold(gotext.Get("There are %d providers available for %s:", size, dep))
@@ -428,8 +428,8 @@ func provideMenu(w io.Writer, dep string, options []*aur.Pkg, noConfirm bool) *a
size = 1
str += text.SprintOperationInfo(gotext.Get("Repository AUR"), "\n ")

for _, pkg := range options {
str += fmt.Sprintf("%d) %s ", size, pkg.Name)
for i := range options {
str += fmt.Sprintf("%d) %s ", size, options[i].Name)
size++
}

@@ -441,7 +441,7 @@ func provideMenu(w io.Writer, dep string, options []*aur.Pkg, noConfirm bool) *a
if noConfirm {
fmt.Fprintln(w, "1")

return options[0]
return &options[0]
}

numberBuf, err := text.GetInput("", false)
@@ -452,7 +452,7 @@ func provideMenu(w io.Writer, dep string, options []*aur.Pkg, noConfirm bool) *a
}

if numberBuf == "" {
return options[0]
return &options[0]
}

num, err := strconv.Atoi(numberBuf)
@@ -468,7 +468,7 @@ func provideMenu(w io.Writer, dep string, options []*aur.Pkg, noConfirm bool) *a
continue
}

return options[num-1]
return &options[num-1]
}

return nil
6 changes: 3 additions & 3 deletions pkg/dep/dep_graph_test.go
Original file line number Diff line number Diff line change
@@ -27,11 +27,11 @@ func getFromFile(t *testing.T, filePath string) mockaur.GetFunc {
fBytes, err := io.ReadAll(f)
require.NoError(t, err)

pkgs := []*aur.Pkg{}
pkgs := []aur.Pkg{}
err = json.Unmarshal(fBytes, &pkgs)
require.NoError(t, err)

return func(ctx context.Context, query *metadata.AURQuery) ([]*aur.Pkg, error) {
return func(ctx context.Context, query *metadata.AURQuery) ([]aur.Pkg, error) {
return pkgs, nil
}
}
@@ -72,7 +72,7 @@ func TestGrapher_GraphFromTargets_jellyfin(t *testing.T) {
},
}

mockAUR := &mockaur.MockAUR{GetFn: func(ctx context.Context, query *metadata.AURQuery) ([]*aur.Pkg, error) {
mockAUR := &mockaur.MockAUR{GetFn: func(ctx context.Context, query *metadata.AURQuery) ([]aur.Pkg, error) {
if query.Needles[0] == "jellyfin" {
jfinFn := getFromFile(t, "testdata/jellyfin.json")
return jfinFn(ctx, query)
4 changes: 2 additions & 2 deletions pkg/dep/mock/aur.go
Original file line number Diff line number Diff line change
@@ -7,13 +7,13 @@ import (
"github.com/Jguer/aur/metadata"
)

type GetFunc func(ctx context.Context, query *metadata.AURQuery) ([]*aur.Pkg, error)
type GetFunc func(ctx context.Context, query *metadata.AURQuery) ([]aur.Pkg, error)

type MockAUR struct {
GetFn GetFunc
}

func (m *MockAUR) Get(ctx context.Context, query *metadata.AURQuery) ([]*aur.Pkg, error) {
func (m *MockAUR) Get(ctx context.Context, query *metadata.AURQuery) ([]aur.Pkg, error) {
if m.GetFn != nil {
return m.GetFn(ctx, query)
}
12 changes: 6 additions & 6 deletions pkg/query/aur_info.go
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@ type Pkg = aur.Pkg
// of packages exceeds the number set in config.RequestSplitN.
// If the number does exceed config.RequestSplitN multiple aur requests will be
// performed concurrently.
func AURInfo(ctx context.Context, aurClient aur.ClientInterface, names []string, warnings *AURWarnings, splitN int) ([]*Pkg, error) {
info := make([]*Pkg, 0, len(names))
func AURInfo(ctx context.Context, aurClient aur.ClientInterface, names []string, warnings *AURWarnings, splitN int) ([]Pkg, error) {
info := make([]Pkg, 0, len(names))
seen := make(map[string]int)

var (
@@ -42,7 +42,7 @@ func AURInfo(ctx context.Context, aurClient aur.ClientInterface, names []string,

mux.Lock()
for i := range tempInfo {
info = append(info, &tempInfo[i])
info = append(info, tempInfo[i])
}
mux.Unlock()
}
@@ -61,8 +61,8 @@ func AURInfo(ctx context.Context, aurClient aur.ClientInterface, names []string,
return info, err
}

for k, pkg := range info {
seen[pkg.Name] = k
for k := range info {
seen[info[k].Name] = k
}

for _, name := range names {
@@ -86,7 +86,7 @@ func AURInfo(ctx context.Context, aurClient aur.ClientInterface, names []string,
return info, nil
}

func AURInfoPrint(ctx context.Context, aurClient aur.ClientInterface, names []string, splitN int) ([]*Pkg, error) {
func AURInfoPrint(ctx context.Context, aurClient aur.ClientInterface, names []string, splitN int) ([]Pkg, error) {
text.OperationInfoln(gotext.Get("Querying AUR..."))

warnings := &AURWarnings{}
8 changes: 4 additions & 4 deletions pkg/query/source.go
Original file line number Diff line number Diff line change
@@ -29,17 +29,17 @@ const (
)

type AURCache interface {
Get(ctx context.Context, query *metadata.AURQuery) ([]*aur.Pkg, error)
Get(ctx context.Context, query *metadata.AURQuery) ([]aur.Pkg, error)
}

type SourceQueryBuilder struct {
repoQuery
aurQuery

useAURCache bool
sortBy string
searchBy string
targetMode parser.TargetMode
useAURCache bool
bottomUp bool
singleLineResults bool

@@ -215,8 +215,8 @@ func queryAUR(ctx context.Context,
Contains: true,
})

for _, pkg := range q {
r = append(r, *pkg)
for i := range q {
r = append(r, q[i])
}

if errM == nil {
2 changes: 1 addition & 1 deletion pkg/settings/runtime.go
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ import (
)

type AURCache interface {
Get(ctx context.Context, query *metadata.AURQuery) ([]*aur.Pkg, error)
Get(ctx context.Context, query *metadata.AURQuery) ([]aur.Pkg, error)
}

type Runtime struct {
6 changes: 3 additions & 3 deletions query.go
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ func syncSearch(ctx context.Context, pkgS []string,
// SyncInfo serves as a pacman -Si for repo packages and AUR packages.
func syncInfo(ctx context.Context, cmdArgs *parser.Arguments, pkgS []string, dbExecutor db.Executor) error {
var (
info []*aur.Pkg
info []aur.Pkg
err error
missing = false
)
@@ -77,8 +77,8 @@ func syncInfo(ctx context.Context, cmdArgs *parser.Arguments, pkgS []string, dbE
}

if len(info) != 0 {
for _, pkg := range info {
PrintInfo(pkg, cmdArgs.ExistsDouble("i"))
for i := range info {
PrintInfo(&info[i], cmdArgs.ExistsDouble("i"))
}
}

5 changes: 3 additions & 2 deletions upgrade.go
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ func upList(ctx context.Context, aurCache settings.AURCache,
if config.Runtime.Mode.AtLeastAUR() {
text.OperationInfoln(gotext.Get("Searching AUR for updates..."))

var _aurdata []*aur.Pkg
var _aurdata []aur.Pkg
if aurCache != nil {
_aurdata, err = aurCache.Get(ctx, &metadata.AURQuery{Needles: remoteNames, By: aur.Name})
} else {
@@ -83,7 +83,8 @@ func upList(ctx context.Context, aurCache settings.AURCache,
errs.Add(err)

if err == nil {
for _, pkg := range _aurdata {
for i := range _aurdata {
pkg := &_aurdata[i]
aurdata[pkg.Name] = pkg
}

Loading