Add ignorePkgUpdates field to config
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Elara 2022-12-18 17:46:40 -08:00
parent 964c45ffc4
commit 22a74aa793
3 changed files with 11 additions and 5 deletions

View File

@ -8,8 +8,9 @@ import (
)
var defaultConfig = types.Config{
RootCmd: "sudo",
PagerStyle: "native",
RootCmd: "sudo",
PagerStyle: "native",
IgnorePkgUpdates: []string{},
Repos: []types.Repo{
{
Name: "default",

View File

@ -2,9 +2,10 @@ package types
// Config represents the LURE configuration file
type Config struct {
RootCmd string `toml:"rootCmd"`
PagerStyle string `toml:"pagerStyle"`
Repos []Repo `toml:"repo"`
RootCmd string `toml:"rootCmd"`
PagerStyle string `toml:"pagerStyle"`
IgnorePkgUpdates []string `toml:"ignorePkgUpdates"`
Repos []Repo `toml:"repo"`
}
// Repo represents a LURE repo within a configuration file

View File

@ -77,6 +77,10 @@ func checkForUpdates(ctx context.Context, mgr manager.Manager, info *distro.OSRe
var out []db.Package
for pkgName, pkgs := range found {
if slices.Contains(cfg.IgnorePkgUpdates, pkgName) {
continue
}
if len(pkgs) > 1 {
// Puts the element with the highest version first
slices.SortFunc(pkgs, func(a, b db.Package) bool {