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

@ -57,13 +57,13 @@ func Match(km config.Target) (pkgs []string, err error) {
return
}
r, err := regexp.Compile("kernel-" + km.ReleaseMask)
r, err := regexp.Compile("kernel-" + km.Kernel.Regex)
if err != nil {
return
}
for _, pkg := range strings.Fields(output) {
if r.MatchString(pkg) || strings.Contains(pkg, km.ReleaseMask) {
if r.MatchString(pkg) || strings.Contains(pkg, km.Kernel.Regex) {
log.Trace().Msg(pkg)
pkgs = append(pkgs, pkg)
}