mirror of
https://github.com/Jguer/yay.git
synced 2025-10-04 00:03:11 -04:00
References #34 fix for yay -Qstats. Also added warnings about packages not available in AUR.
This commit is contained in:
parent
d8f1c382b1
commit
7608c6338d
@ -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
query.go
34
query.go
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user