1
0

fix: support --no-headers for debian

This commit is contained in:
dump_stack() 2023-05-17 06:50:52 +00:00
parent 706d442948
commit 72f52d3200
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
2 changed files with 11 additions and 3 deletions

View File

@ -14,6 +14,7 @@ import (
"code.dumpstack.io/tools/out-of-tree/cache"
"code.dumpstack.io/tools/out-of-tree/config"
"code.dumpstack.io/tools/out-of-tree/container"
"code.dumpstack.io/tools/out-of-tree/distro/debian/snapshot"
"code.dumpstack.io/tools/out-of-tree/fs"
)
@ -316,13 +317,20 @@ func ContainerVolumes(km config.KernelMask, pkgname string) (volumes container.V
return
}
func InstallCommands(km config.KernelMask, pkgname string) (cmds []string, err error) {
func InstallCommands(km config.KernelMask, pkgname string, headers bool) (cmds []string, err error) {
dk, err := getCachedKernel(pkgname + ".deb")
if err != nil {
return
}
for _, pkg := range dk.Packages() {
var pkgs []snapshot.Package
if headers {
pkgs = dk.Packages()
} else {
pkgs = []snapshot.Package{dk.Image}
}
for _, pkg := range pkgs {
found, newurl := cache.PackageURL(
km.DistroType,
pkg.Deb.URL,

View File

@ -407,7 +407,7 @@ func installKernel(sk config.KernelMask, pkgname string, force, headers bool) (e
}
case config.Debian:
var commands []string
commands, err = debian.InstallCommands(sk, pkgname)
commands, err = debian.InstallCommands(sk, pkgname, headers)
if err != nil {
return
}