fix: check if cache already exists
This commit is contained in:
parent
065aca24b0
commit
39f4cd4cfd
@ -10,6 +10,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/fs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Release int
|
type Release int
|
||||||
@ -131,9 +132,13 @@ func MatchImagePkg(km config.KernelMask) (pkgs []string, err error) {
|
|||||||
CachePath = config.File("debian.cache")
|
CachePath = config.File("debian.cache")
|
||||||
log.Debug().Msgf("Use default kernels cache path: %s", CachePath)
|
log.Debug().Msgf("Use default kernels cache path: %s", CachePath)
|
||||||
|
|
||||||
|
if !fs.PathExists(CachePath) {
|
||||||
|
log.Debug().Msgf("No cache, download")
|
||||||
err = cache.DownloadDebianCache(CachePath)
|
err = cache.DownloadDebianCache(CachePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debug().Err(err).Msg("No remote cache, will take some time")
|
log.Debug().Err(err).Msg(
|
||||||
|
"No remote cache, will take some time")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.Debug().Msgf("Debian kernels cache path: %s", CachePath)
|
log.Debug().Msgf("Debian kernels cache path: %s", CachePath)
|
||||||
|
Loading…
Reference in New Issue
Block a user