1
0

fix: use distro equal check

This commit is contained in:
dump_stack() 2023-05-23 23:02:09 +00:00
parent 66d45e69d9
commit 77e118be64
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
2 changed files with 10 additions and 7 deletions

View File

@ -168,13 +168,7 @@ type Artifact struct {
func (ka Artifact) checkSupport(ki distro.KernelInfo, km Target) ( func (ka Artifact) checkSupport(ki distro.KernelInfo, km Target) (
supported bool, err error) { supported bool, err error) {
if ki.Distro.ID != km.Distro.ID { if !ki.Distro.Equal(km.Distro) {
supported = false
return
}
// DistroRelease is optional
if km.Distro.Release != "" && ki.Distro.Release != km.Distro.Release {
supported = false supported = false
return return
} }

View File

@ -75,3 +75,12 @@ func (d Distro) Kernels() (kernels []KernelInfo, err error) {
} }
return return
} }
func (d Distro) Equal(to Distro) bool {
for _, dd := range distros {
if dd.Equal(d) {
return dd.Equal(to)
}
}
return false
}