1
0

refactor: move ubutu install/cleanup to module

This commit is contained in:
2023-05-18 11:46:12 +00:00
parent 407c1a7975
commit 6a338fc6ad
2 changed files with 32 additions and 4 deletions

View File

@ -82,3 +82,23 @@ func Match(km config.KernelMask) (pkgs []string, err error) {
return
}
func Install(km config.KernelMask, pkgname string, headers bool) (commands []string, err error) {
var headerspkg string
if headers {
headerspkg = strings.Replace(pkgname, "image", "headers", -1)
}
cmdf := func(f string, s ...interface{}) {
commands = append(commands, fmt.Sprintf(f, s...))
}
cmdf("apt-get install -y %s %s", pkgname, headerspkg)
return
}
func Cleanup(km config.KernelMask, pkgname string) {
return
}