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/cache"
|
||||||
"code.dumpstack.io/tools/out-of-tree/config"
|
"code.dumpstack.io/tools/out-of-tree/config"
|
||||||
"code.dumpstack.io/tools/out-of-tree/container"
|
"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"
|
"code.dumpstack.io/tools/out-of-tree/fs"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -316,13 +317,20 @@ func ContainerVolumes(km config.KernelMask, pkgname string) (volumes container.V
|
|||||||
return
|
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")
|
dk, err := getCachedKernel(pkgname + ".deb")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
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(
|
found, newurl := cache.PackageURL(
|
||||||
km.DistroType,
|
km.DistroType,
|
||||||
pkg.Deb.URL,
|
pkg.Deb.URL,
|
||||||
|
@ -407,7 +407,7 @@ func installKernel(sk config.KernelMask, pkgname string, force, headers bool) (e
|
|||||||
}
|
}
|
||||||
case config.Debian:
|
case config.Debian:
|
||||||
var commands []string
|
var commands []string
|
||||||
commands, err = debian.InstallCommands(sk, pkgname)
|
commands, err = debian.InstallCommands(sk, pkgname, headers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user