From f42279508d303488d59db0129dc5da476802d940 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 28 Jun 2017 07:24:32 -0700 Subject: [PATCH] Reset plugin constraint on update if explicit version set --- lib/vagrant/bundler.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index ea406dc1e..1f0f58fd9 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -223,11 +223,13 @@ module Vagrant # Generate all required plugin deps plugin_deps = plugins.map do |name, info| + gem_version = info['gem_version'].to_s.empty? ? '> 0' : info['gem_version'] if update[:gems] == true || (update[:gems].respond_to?(:include?) && update[:gems].include?(name)) - gem_version = plugins[name]["gem_version"].to_s.empty? ? "> 0" : plugins[name]["gem_version"] + if Gem::Requirement.new(gem_version).exact? + gem_version = "> 0" + @logger.debug("Detected exact version match for `#{name}` plugin update. Reset to loose constraint #{gem_version.inspect}.") + end skips << name - else - gem_version = info['gem_version'].to_s.empty? ? '> 0' : info['gem_version'] end source_list[name] ||= [] if plugin_source = info.delete("local_source")