From 8adb502aa0f7410039444ca2c7bd25cffdba578d Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Tue, 28 Jun 2022 12:48:21 +0200 Subject: [PATCH] gen-manifests: add flag for setting cache location --- cmd/gen-manifests/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/gen-manifests/main.go b/cmd/gen-manifests/main.go index 0a1ba1170..08143b022 100644 --- a/cmd/gen-manifests/main.go +++ b/cmd/gen-manifests/main.go @@ -24,8 +24,6 @@ import ( "github.com/osbuild/osbuild-composer/internal/rpmmd" ) -const cacheRoot = "/tmp/rpmmd" - type repository struct { Name string `json:"name"` BaseURL string `json:"baseurl,omitempty"` @@ -94,7 +92,7 @@ func loadFormatRequestMap() formatRequestMap { type manifestJob func(chan string) error -func makeManifestJob(name string, imgType distro.ImageType, cr composeRequest, distribution distro.Distro, archName string, seedArg int64, path string) manifestJob { +func makeManifestJob(name string, imgType distro.ImageType, cr composeRequest, distribution distro.Distro, archName string, seedArg int64, path string, cacheRoot string) manifestJob { distroName := distribution.Name() u := func(s string) string { return strings.Replace(s, "-", "_", -1) @@ -309,10 +307,12 @@ func mergeOverrides(base, overrides composeRequest) composeRequest { func main() { outputDirFlag := flag.String("output", "test/data/manifests.plain/", "") nWorkersFlag := flag.Int("workers", 16, "") + cacheRootFlag := flag.String("cache", "/tmp/rpmmd", "") flag.Parse() outputDir := *outputDirFlag nWorkers := *nWorkersFlag + cacheRoot := *cacheRootFlag seedArg := int64(0) darm := readRepos() @@ -363,7 +363,7 @@ func main() { composeReq := req.ComposeRequest composeReq.Repositories = filterRepos(repos, imgTypeName) - job := makeManifestJob(jobName, imgType, composeReq, distribution, archName, seedArg, outputDir) + job := makeManifestJob(jobName, imgType, composeReq, distribution, archName, seedArg, outputDir, cacheRoot) jobs = append(jobs, job) } }