Skip to content

Commit

Permalink
References Jguer#34 fix for yay -Qstats. Also added warnings about pa…
Browse files Browse the repository at this point in the history
…ckages not available in AUR.
Jguer committed Jul 6, 2017
1 parent d8f1c38 commit 7608c63
Showing 2 changed files with 37 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -36,7 +36,10 @@ Yay was created with a few objectives in mind and based on the design of yaourt

### Changelog

#### 2.
#### 2.159
- Qstats now warns about packages not available in AUR.

#### 2.152
- Fetching backend changed to Mikkel Oscar's [Aur](https://github.com/mikkeloscar/aur)
- Added support for development packages from github.
- Pacman backend rewritten and simplified
34 changes: 33 additions & 1 deletion query.go
Original file line number Diff line number Diff line change
@@ -119,7 +119,35 @@ func localStatistics(version string) error {
keys[i] = k
i++
}
q, err := rpc.Info(keys)

var q aur.Query
var j int
for i = len(keys); i != 0; i = j {
j = i - config.YayConf.RequestSplitN
if j < 0 {
j = 0
}
qtemp, err := rpc.Info(keys[j:i])
q = append(q, qtemp...)
if err != nil {
return err
}
}

var outcast []string
for _, s := range keys {
found := false
for _, i := range q {
if s == i.Name {
found = true
break
}
}
if !found {
outcast = append(outcast, s)
}
}

if err != nil {
return err
}
@@ -133,5 +161,9 @@ func localStatistics(version string) error {
}
}

for _, res := range outcast {
fmt.Printf("\x1b[1;31;40mWarning: \x1B[1;33;40m%s\x1b[0;37;40m is not available in AUR.\x1b[0m\n", res)
}

return nil
}

0 comments on commit 7608c63

Please sign in to comment.