mirror of
https://github.com/Jguer/yay.git
synced 2025-11-11 00:05:36 -05:00
feat(query): list debug packages missing from AUR separately
This commit is contained in:
parent
5184ef6a04
commit
3efb43af95
@ -2,6 +2,7 @@ package query
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
|
|
||||||
@ -21,9 +22,16 @@ func NewWarnings() *AURWarnings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (warnings *AURWarnings) Print() {
|
func (warnings *AURWarnings) Print() {
|
||||||
if len(warnings.Missing) > 0 {
|
normalMissing, debugMissing := filterDebugPkgs(warnings.Missing)
|
||||||
|
|
||||||
|
if len(normalMissing) > 0 {
|
||||||
text.Warn(gotext.Get("Missing AUR Packages:"))
|
text.Warn(gotext.Get("Missing AUR Packages:"))
|
||||||
printRange(warnings.Missing)
|
printRange(normalMissing)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(debugMissing) > 0 {
|
||||||
|
text.Warn(gotext.Get("Missing AUR Debug Packages:"))
|
||||||
|
printRange(debugMissing)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(warnings.Orphans) > 0 {
|
if len(warnings.Orphans) > 0 {
|
||||||
@ -37,6 +45,21 @@ func (warnings *AURWarnings) Print() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func filterDebugPkgs(names []string) (normal, debug []string) {
|
||||||
|
normal = make([]string, 0)
|
||||||
|
debug = make([]string, 0)
|
||||||
|
|
||||||
|
for _, name := range names {
|
||||||
|
if strings.HasSuffix(name, "-debug") {
|
||||||
|
debug = append(debug, name)
|
||||||
|
} else {
|
||||||
|
normal = append(normal, name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func printRange(names []string) {
|
func printRange(names []string) {
|
||||||
for _, name := range names {
|
for _, name := range names {
|
||||||
fmt.Print(" " + text.Cyan(name))
|
fmt.Print(" " + text.Cyan(name))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user