gocage fetch finished

This commit is contained in:
yo
2022-11-06 16:34:52 +01:00
parent 9e506145a8
commit 667c73216e
3 changed files with 257 additions and 74 deletions

View File

@ -14,7 +14,7 @@ import (
)
const (
gVersion = "0.31"
gVersion = "0.32a"
// TODO : Get from $jail_zpool/defaults.json
MIN_DYN_DEVFS_RULESET = 1000
@ -53,6 +53,7 @@ var (
gFetchRelease string
gFetchIntoDS string
gFetchFrom string
rootCmd = &cobra.Command{
@ -293,7 +294,12 @@ You can specify multiple datastores.`,
Use: "fetch",
Short: "Fetch FreeBSD release to local datastore",
Run: func(cmd *cobra.Command, args []string) {
fetchRelease(gFetchRelease, "http", gJailHost.arch, gFetchIntoDS)
err := fetchRelease(gFetchRelease, "http", gJailHost.arch, gFetchIntoDS, gFetchFrom)
if err != nil {
fmt.Printf("%v\n", err)
} else {
extractRelease(gFetchRelease, gFetchIntoDS)
}
},
}
@ -352,6 +358,7 @@ func init() {
fetchCmd.Flags().StringVarP(&gFetchRelease, "release", "r", "", "Release to fetch (e.g.: \"13.1\"")
fetchCmd.Flags().StringVarP(&gFetchIntoDS, "datastore", "o", "", "Datastore release will be saved to")
fetchCmd.Flags().StringVarP(&gFetchFrom, "from", "d", "", "Repository to download from. Should contain XY.Z-RELEASE. File protocol supported")
fetchCmd.MarkFlagRequired("release")
fetchCmd.MarkFlagRequired("datastore")