use plugin cache for provider lock across for all platforms

The cache architecture already supports multi-platform, the only
downside is that this might grow the cache. This seems expected.
use-plugin-cache-for-provider-lock
Daniel Schmidt 2 years ago
parent 2c98e6a347
commit f720a060ff
No known key found for this signature in database
GPG Key ID: 377C3A4D62FBBBE2

@ -249,8 +249,8 @@ func (c *ProvidersLockCommand) Run(args []string) int {
// Use global plugin cache for extra speed if this architecture matches the systems (and therefore the caches) one
globalCacheDir := c.providerGlobalCacheDir()
if globalCacheDir != nil && platform == getproviders.CurrentPlatform {
installer.SetGlobalCacheDir(globalCacheDir)
if globalCacheDir != nil {
installer.SetGlobalCacheDir(globalCacheDir.WithPlatform(platform))
installer.SetGlobalCacheDirMayBreakDependencyLockFile(c.PluginCacheMayBreakDependencyLockFile)
}

@ -75,6 +75,12 @@ func (d *Dir) BasePath() string {
return filepath.Clean(d.baseDir)
}
// WithPlatform creates a new dir with the provided platform based
// on this dir
func (d *Dir) WithPlatform(platform getproviders.Platform) *Dir {
return NewDirWithPlatform(d.baseDir, platform)
}
// AllAvailablePackages returns a description of all of the packages already
// present in the directory. The cache entries are grouped by the provider
// they relate to and then sorted by version precedence, with highest

Loading…
Cancel
Save