mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 09:07:21 +01:00
Hide warnings for ignored packages
This commit is contained in:
parent
0bd21ea29f
commit
ab956ea3d2
@ -59,7 +59,7 @@ func install(parser *arguments) (err error) {
|
|||||||
|
|
||||||
var srcinfos map[string]*gosrc.Srcinfo
|
var srcinfos map[string]*gosrc.Srcinfo
|
||||||
|
|
||||||
warnings := &aurWarnings{}
|
warnings := makeWarnings()
|
||||||
|
|
||||||
if mode == modeAny || mode == modeRepo {
|
if mode == modeAny || mode == modeRepo {
|
||||||
if config.CombinedUpgrade {
|
if config.CombinedUpgrade {
|
||||||
|
@ -27,6 +27,13 @@ func (set StringSet) Set(v string) {
|
|||||||
set[v] = struct{}{}
|
set[v] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extend sets multiple keys in StringSet.
|
||||||
|
func (set StringSet) Extend(s ...string) {
|
||||||
|
for _, v := range s {
|
||||||
|
set[v] = struct{}{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get returns true if the key exists in the set.
|
// Get returns true if the key exists in the set.
|
||||||
func (set StringSet) Get(v string) bool {
|
func (set StringSet) Get(v string) bool {
|
||||||
_, exists := set[v]
|
_, exists := set[v]
|
||||||
|
11
query.go
11
query.go
@ -20,6 +20,11 @@ type aurWarnings struct {
|
|||||||
Orphans []string
|
Orphans []string
|
||||||
OutOfDate []string
|
OutOfDate []string
|
||||||
Missing []string
|
Missing []string
|
||||||
|
Ignore stringset.StringSet
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeWarnings() *aurWarnings {
|
||||||
|
return &aurWarnings{Ignore: make(stringset.StringSet)}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Query is a collection of Results
|
// Query is a collection of Results
|
||||||
@ -538,17 +543,17 @@ func aurInfo(names []string, warnings *aurWarnings) ([]*rpc.Pkg, error) {
|
|||||||
|
|
||||||
for _, name := range names {
|
for _, name := range names {
|
||||||
i, ok := seen[name]
|
i, ok := seen[name]
|
||||||
if !ok {
|
if !ok && !warnings.Ignore.Get(name) {
|
||||||
warnings.Missing = append(warnings.Missing, name)
|
warnings.Missing = append(warnings.Missing, name)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg := info[i]
|
pkg := info[i]
|
||||||
|
|
||||||
if pkg.Maintainer == "" {
|
if pkg.Maintainer == "" && !warnings.Ignore.Get(name) {
|
||||||
warnings.Orphans = append(warnings.Orphans, name)
|
warnings.Orphans = append(warnings.Orphans, name)
|
||||||
}
|
}
|
||||||
if pkg.OutOfDate != 0 {
|
if pkg.OutOfDate != 0 && !warnings.Ignore.Get(name) {
|
||||||
warnings.OutOfDate = append(warnings.OutOfDate, name)
|
warnings.OutOfDate = append(warnings.OutOfDate, name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,6 +128,12 @@ func upList(warnings *aurWarnings) (upSlice, upSlice, error) {
|
|||||||
|
|
||||||
aurdata := make(map[string]*rpc.Pkg)
|
aurdata := make(map[string]*rpc.Pkg)
|
||||||
|
|
||||||
|
for _, pkg := range remote {
|
||||||
|
if pkg.ShouldIgnore() {
|
||||||
|
warnings.Ignore.Set(pkg.Name())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if mode == modeAny || mode == modeRepo {
|
if mode == modeAny || mode == modeRepo {
|
||||||
fmt.Println(bold(cyan("::") + bold(" Searching databases for updates...")))
|
fmt.Println(bold(cyan("::") + bold(" Searching databases for updates...")))
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user