diff --git a/install.go b/install.go index cb54f857..f0a14b05 100644 --- a/install.go +++ b/install.go @@ -59,7 +59,7 @@ func install(parser *arguments) (err error) { var srcinfos map[string]*gosrc.Srcinfo - warnings := &aurWarnings{} + warnings := makeWarnings() if mode == modeAny || mode == modeRepo { if config.CombinedUpgrade { diff --git a/pkg/stringset/stringset.go b/pkg/stringset/stringset.go index 7505e0da..89ac638c 100644 --- a/pkg/stringset/stringset.go +++ b/pkg/stringset/stringset.go @@ -27,6 +27,13 @@ func (set StringSet) Set(v string) { 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. func (set StringSet) Get(v string) bool { _, exists := set[v] diff --git a/query.go b/query.go index 68b1154d..0f0ebd47 100644 --- a/query.go +++ b/query.go @@ -20,6 +20,11 @@ type aurWarnings struct { Orphans []string OutOfDate []string Missing []string + Ignore stringset.StringSet +} + +func makeWarnings() *aurWarnings { + return &aurWarnings{Ignore: make(stringset.StringSet)} } // Query is a collection of Results @@ -538,17 +543,17 @@ func aurInfo(names []string, warnings *aurWarnings) ([]*rpc.Pkg, error) { for _, name := range names { i, ok := seen[name] - if !ok { + if !ok && !warnings.Ignore.Get(name) { warnings.Missing = append(warnings.Missing, name) continue } pkg := info[i] - if pkg.Maintainer == "" { + if pkg.Maintainer == "" && !warnings.Ignore.Get(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) } } diff --git a/upgrade.go b/upgrade.go index c31ab0eb..c6379438 100644 --- a/upgrade.go +++ b/upgrade.go @@ -128,6 +128,12 @@ func upList(warnings *aurWarnings) (upSlice, upSlice, error) { aurdata := make(map[string]*rpc.Pkg) + for _, pkg := range remote { + if pkg.ShouldIgnore() { + warnings.Ignore.Set(pkg.Name()) + } + } + if mode == modeAny || mode == modeRepo { fmt.Println(bold(cyan("::") + bold(" Searching databases for updates..."))) wg.Add(1)