1
0

fix: remove type from kernel release

This commit is contained in:
dump_stack() 2023-06-20 16:01:38 +00:00
parent 41c4241d75
commit 56faf1a351
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
2 changed files with 13 additions and 1 deletions

View File

@ -96,7 +96,17 @@ func (suse OpenSUSE) Kernels() (kernels []distro.KernelInfo, err error) {
return return
} }
return c.Kernels() kernels, err = c.Kernels()
if err != nil {
return
}
for i := range kernels {
kernels[i].KernelRelease = strings.Replace(
kernels[i].KernelRelease, "-default", "", -1)
}
return
} }
func (suse OpenSUSE) envs() (envs []string) { func (suse OpenSUSE) envs() (envs []string) {

View File

@ -107,6 +107,8 @@ func (cmd *KernelCmd) GenKernel(km config.Target, pkg string) {
var found bool var found bool
if kinfo.Distro.ID == distro.Debian { // FIXME if kinfo.Distro.ID == distro.Debian { // FIXME
found = pkg == kinfo.Package found = pkg == kinfo.Package
} else if kinfo.Distro.ID == distro.OpenSUSE {
found = strings.Contains(pkg, kinfo.KernelRelease)
} else { } else {
found = strings.Contains(pkg, kinfo.KernelVersion) found = strings.Contains(pkg, kinfo.KernelVersion)
} }