Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: client/cmd/cipd/friendly.go

Issue 1862303004: cipd: shared tag cache (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: Remove caveat, inline help Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/cipd/client.go ('k') | client/cmd/cipd/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cmd/cipd/friendly.go
diff --git a/client/cmd/cipd/friendly.go b/client/cmd/cipd/friendly.go
index 4c9cd56c957a52b57f3f96c0210d1e12e27a452d..e9ae78b53f0884b17a3d7f838dad19fbe473c1ab 100644
--- a/client/cmd/cipd/friendly.go
+++ b/client/cmd/cipd/friendly.go
@@ -89,6 +89,8 @@ type installationSiteConfig struct {
DefaultVersion string
// TrackedVersions is mapping package name -> version to use in 'update'.
TrackedVersions map[string]string
+ // CacheDir contains shared cache.
+ CacheDir string
}
// read loads JSON from given path.
@@ -199,11 +201,12 @@ func (site *installationSite) initClient(authFlags authcli.Flags) (err error) {
if site.client != nil {
return errors.New("client is already initialized")
}
- serviceOpts := ServiceOptions{
+ clientOpts := ClientOptions{
authFlags: authFlags,
serviceURL: site.cfg.ServiceURL,
+ cacheDir: site.cfg.CacheDir,
}
- site.client, err = serviceOpts.makeCipdClient(site.siteRoot)
+ site.client, err = clientOpts.makeCipdClient(site.siteRoot)
return
}
@@ -382,6 +385,7 @@ var cmdInit = &subcommands.Command{
c.registerBaseFlags()
c.Flags.BoolVar(&c.force, "force", false, "Create the site root even if the directory is not empty or already under another site root directory.")
c.Flags.StringVar(&c.serviceURL, "service-url", "", "URL of a backend to use instead of the default one.")
+ c.Flags.StringVar(&c.cacheDir, "cache-dir", "", "Directory for shared cache")
return c
},
}
@@ -391,6 +395,7 @@ type initRun struct {
force bool
serviceURL string
+ cacheDir string
}
func (c *initRun) Run(a subcommands.Application, args []string) int {
@@ -407,6 +412,7 @@ func (c *initRun) Run(a subcommands.Application, args []string) int {
}
err = site.modifyConfig(func(cfg *installationSiteConfig) error {
cfg.ServiceURL = c.serviceURL
+ cfg.CacheDir = c.cacheDir
return nil
})
return c.done(site.siteRoot, err)
« no previous file with comments | « client/cipd/client.go ('k') | client/cmd/cipd/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698