diff options
| author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-28 15:00:39 +0200 |
|---|---|---|
| committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-28 15:00:39 +0200 |
| commit | f143b3744afd2293d340ea8c90601d3dc48e0b54 (patch) | |
| tree | 26121556601b85658d5050fc92eaa6a73b0d454b /lib | |
| parent | d190f337c2f410ee7e3deedd5052aa0351afa19f (diff) | |
| download | bundler-f143b3744afd2293d340ea8c90601d3dc48e0b54.tar.gz | |
Properly detect the platform mismatch casefix_bundle_update_crash
And show a proper warning. The other case already shows a message
somewhere else ("Gems for group <bla> were not updated/installed"), so I
just skip any warning in that case.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bundler/cli/update.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb index bd2093f125..ae5b8444d7 100644 --- a/lib/bundler/cli/update.rb +++ b/lib/bundler/cli/update.rb @@ -61,7 +61,7 @@ module Bundler if locked_gems = Bundler.definition.locked_gems previous_locked_info = locked_gems.specs.reduce({}) do |h, s| - h[s.name] = { :version => s.version, :source => s.source.to_s } + h[s.name] = { :spec => s, :version => s.version, :source => s.source.to_s } h end end @@ -79,8 +79,15 @@ module Bundler locked_info = previous_locked_info[name] next unless locked_info + locked_spec = locked_info[:spec] new_spec = Bundler.definition.specs[name].first - next unless new_spec + unless new_spec + if Bundler.rubygems.platforms.none? {|p| locked_spec.match_platform(p) } + Bundler.ui.warn "Bundler attempted to update #{name} but it was not considered because it is for a different platform from the current one" + end + + next + end locked_source = locked_info[:source] new_source = new_spec.source.to_s |
