1
0

feat!: new kernel config structure

BREAKING CHANGE: kernel definition in the configuration files has switched

from

  [[targets]]
  distro = { id = "Ubuntu", release = "18.04" }
  release_mask = ".*"

to

  [[targets]]
  distro = { id = "Ubuntu", release = "18.04" }
  kernel = { regex = ".*" }
This commit is contained in:
2023-05-18 18:48:09 +00:00
parent d551cc8fc4
commit 73f5df2425
15 changed files with 61 additions and 175 deletions

View File

@ -120,7 +120,7 @@ func Match(km config.Target) (pkgs []string, err error) {
release := releaseFromString(km.Distro.Release)
r := regexp.MustCompile(km.ReleaseMask)
r := regexp.MustCompile(km.Kernel.Regex)
for _, dk := range kernels {
p := strings.Replace(dk.Image.Deb.Name, ".deb", "", -1)

View File

@ -25,8 +25,8 @@ func TestMatch(t *testing.T) {
config.Directory = tmp
km := config.Target{
ReleaseMask: "3.2.0-4",
Distro: distro.Distro{Release: "7"},
Distro: distro.Distro{Release: "7"},
Kernel: config.Kernel{Regex: "3.2.0-4"},
}
pkgs, err := Match(km)