ppp now can be passed a list of partial package names to match on
This commit is contained in:
parent
2462b7eab3
commit
dc5a2a923f
12
src/main.go
12
src/main.go
@ -7,7 +7,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"ppp/v2/deb"
|
"ppp/v2/deb"
|
||||||
"slices"
|
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
@ -83,7 +82,7 @@ func processFile(url string, config config) map[string]packageInfo {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(config.Match) > 0 && !slices.Contains(config.Match, stanza["Package"]) {
|
if len(config.Match) > 0 && !nameContains(stanza["Package"], config.Match) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,6 +111,15 @@ func processFile(url string, config config) map[string]packageInfo {
|
|||||||
return packages
|
return packages
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func nameContains(name string, match []string) bool {
|
||||||
|
for _, m := range match {
|
||||||
|
if strings.Contains(name, m) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func compare(basePackages map[string]packageInfo, targetPackages map[string]packageInfo, download bool) map[string]packageInfo {
|
func compare(basePackages map[string]packageInfo, targetPackages map[string]packageInfo, download bool) map[string]packageInfo {
|
||||||
output := make(map[string]packageInfo)
|
output := make(map[string]packageInfo)
|
||||||
for pack, info := range targetPackages {
|
for pack, info := range targetPackages {
|
||||||
|
Loading…
Reference in New Issue
Block a user