fix: support --no-headers for debian
This commit is contained in:
parent
706d442948
commit
72f52d3200
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user