diff options
author | André Arko <mail@arko.net> | 2015-04-25 02:11:27 -0400 |
---|---|---|
committer | André Arko <mail@arko.net> | 2015-04-25 02:11:27 -0400 |
commit | fd8a27eb08eaf1f07bbf5af9b2433849529d18fb (patch) | |
tree | cd98fb87d93e05bf20fc6a3e7001a27f5fe99510 /lib | |
parent | a0c90cd53a436b1856c8bcfbdaa44997870e4488 (diff) | |
parent | 25bf713bf071665b02e4817aeece7951e7bf5b22 (diff) | |
download | bundler-fd8a27eb08eaf1f07bbf5af9b2433849529d18fb.tar.gz |
Merge pull request #3592 from TimMoore/issue-3585-replace-locked-sources
Replace locked gem sources with Gemfile equivalents.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/definition.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 5198a8e3..2b15b155 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -184,11 +184,10 @@ module Bundler # @return [SpecSet] resolved dependencies def resolve @resolve ||= begin + last_resolve = converge_locked_specs if Bundler.settings[:frozen] || (!@unlocking && nothing_changed?) - @locked_specs + last_resolve else - last_resolve = converge_locked_specs - # Run a resolve against the locally available gems last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve) end @@ -518,7 +517,9 @@ module Bundler converged = [] @locked_specs.each do |s| - s.source = sources.get(s.source) + # Replace the locked dependency's source with the equivalent source from the Gemfile + dep = @dependencies.find { |dep| s.satisfies?(dep) } + s.source = (dep && dep.source) || sources.get(s.source) # Don't add a spec to the list if its source is expired. For example, # if you change a Git gem to Rubygems. @@ -566,7 +567,7 @@ module Bundler end def satisfies_locked_spec?(dep) - @locked_specs.any? { |s| s.satisfies?(dep) && (!dep.source || s.source == dep.source) } + @locked_specs.any? { |s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) } end def expanded_dependencies |