1
0
out-of-tree/debian.go

33 lines
648 B
Go
Raw Normal View History

2023-05-11 20:08:08 +00:00
package main
import (
"github.com/rs/zerolog/log"
"code.dumpstack.io/tools/out-of-tree/distro/debian"
)
type DebianCmd struct {
Cache DebianCacheCmd `cmd:"" help:"populate cache"`
}
type DebianCacheCmd struct {
2023-05-12 00:07:51 +00:00
Path string `help:"path to cache" default:"debian.cache"`
Refetch int `help:"days before refetch versions without deb package" default:"7"`
2023-05-11 20:08:08 +00:00
}
func (cmd *DebianCacheCmd) Run() (err error) {
2023-05-14 12:37:45 +00:00
debian.CachePath = cmd.Path
debian.RefetchDays = cmd.Refetch
2023-05-11 20:08:08 +00:00
2023-05-12 15:00:50 +00:00
log.Info().Msg("Fetching kernels...")
2023-05-14 12:37:45 +00:00
_, err = debian.GetKernels()
2023-05-11 20:08:08 +00:00
if err != nil {
2023-05-12 15:00:50 +00:00
log.Error().Err(err).Msg("")
2023-05-11 20:08:08 +00:00
return
}
2023-05-12 15:00:50 +00:00
log.Info().Msg("Success")
2023-05-11 20:08:08 +00:00
return
}