feat: add kernels list to distro interface
This commit is contained in:
@@ -11,6 +11,7 @@ type distribution interface {
|
||||
Distro() Distro
|
||||
Equal(Distro) bool
|
||||
Packages() (packages []string, err error)
|
||||
Kernels() (kernels []KernelInfo, err error)
|
||||
}
|
||||
|
||||
func Register(d distribution) {
|
||||
@@ -52,3 +53,12 @@ func (d Distro) Packages() (packages []string, err error) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (d Distro) Kernels() (kernels []KernelInfo, err error) {
|
||||
for _, dd := range distros {
|
||||
if dd.Equal(d) {
|
||||
return dd.Kernels()
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user