Add ignorePkgUpdates field to config
This commit is contained in:
parent
718f7e115f
commit
842c88701f
|
@ -8,8 +8,9 @@ import (
|
|||
)
|
||||
|
||||
var defaultConfig = types.Config{
|
||||
RootCmd: "sudo",
|
||||
PagerStyle: "native",
|
||||
RootCmd: "sudo",
|
||||
PagerStyle: "native",
|
||||
IgnorePkgUpdates: []string{},
|
||||
Repos: []types.Repo{
|
||||
{
|
||||
Name: "default",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue