From fb536f5292dea13982987325c756de1ad06262c8 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Mon, 2 Dec 2024 17:18:07 +0000 Subject: [PATCH] fix: skip retracted kernels --- distro/opensuse/opensuse.go | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/distro/opensuse/opensuse.go b/distro/opensuse/opensuse.go index 914641e..08399d9 100644 --- a/distro/opensuse/opensuse.go +++ b/distro/opensuse/opensuse.go @@ -87,7 +87,32 @@ func (suse OpenSUSE) Packages() (pkgs []string, err error) { return } - pkgs = append(pkgs, strings.Fields(output)...) + // TODO Find a way for non-interactive installation of + // retracted kernels + retracted := []string{ + "5.14.21-150400.24.49.3", + "5.14.21-150400.24.84.1", + "5.14.21-150500.55.22.1", + "5.3.18-150300.59.81.1", + "5.3.18-59.30.1", + "5.3.18-lp152.98.1", + } + + for _, k := range strings.Fields(output) { + skip := false + for _, rk := range retracted { + if rk == k { + skip = true + break + } + } + if skip { + continue + } + + pkgs = append(pkgs, k) + } + return }