Add ignorePkgUpdates field to config
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
964c45ffc4
commit
22a74aa793
|
@ -8,8 +8,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var defaultConfig = types.Config{
|
var defaultConfig = types.Config{
|
||||||
RootCmd: "sudo",
|
RootCmd: "sudo",
|
||||||
PagerStyle: "native",
|
PagerStyle: "native",
|
||||||
|
IgnorePkgUpdates: []string{},
|
||||||
Repos: []types.Repo{
|
Repos: []types.Repo{
|
||||||
{
|
{
|
||||||
Name: "default",
|
Name: "default",
|
||||||
|
|
|
@ -2,9 +2,10 @@ package types
|
||||||
|
|
||||||
// Config represents the LURE configuration file
|
// Config represents the LURE configuration file
|
||||||
type Config struct {
|
type Config struct {
|
||||||
RootCmd string `toml:"rootCmd"`
|
RootCmd string `toml:"rootCmd"`
|
||||||
PagerStyle string `toml:"pagerStyle"`
|
PagerStyle string `toml:"pagerStyle"`
|
||||||
Repos []Repo `toml:"repo"`
|
IgnorePkgUpdates []string `toml:"ignorePkgUpdates"`
|
||||||
|
Repos []Repo `toml:"repo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Repo represents a LURE repo within a configuration file
|
// 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
|
var out []db.Package
|
||||||
for pkgName, pkgs := range found {
|
for pkgName, pkgs := range found {
|
||||||
|
if slices.Contains(cfg.IgnorePkgUpdates, pkgName) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if len(pkgs) > 1 {
|
if len(pkgs) > 1 {
|
||||||
// Puts the element with the highest version first
|
// Puts the element with the highest version first
|
||||||
slices.SortFunc(pkgs, func(a, b db.Package) bool {
|
slices.SortFunc(pkgs, func(a, b db.Package) bool {
|
||||||
|
|
Loading…
Reference in New Issue