diff options
author | The Bundler Bot <bot@bundler.io> | 2017-02-18 16:46:06 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2017-02-18 16:46:06 +0000 |
commit | 42215fe7279bd90d48f2d4e09227d327e007b5bc (patch) | |
tree | 0011a9f2ea7a395e33d2cb7e33aa0a615cedc327 /lib/bundler/remote_specification.rb | |
parent | cc4414ca7cfe76989ecbefec8408e2c26cdaf71d (diff) | |
parent | fe0fdb108b9a72889383b99d98dd8e58ae75a557 (diff) | |
download | bundler-42215fe7279bd90d48f2d4e09227d327e007b5bc.tar.gz |
Auto merge of #5427 - bundler:seg-api-missing-dependencies, r=indirect
Fail gracefully when installing a spec where the API is missing deps
Fixes https://github.com/bundler/bundler/issues/5426
Closes https://github.com/bundler/bundler/issues/5339
Diffstat (limited to 'lib/bundler/remote_specification.rb')
-rw-r--r-- | lib/bundler/remote_specification.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb index 944ff1adbd..e5f9c78b00 100644 --- a/lib/bundler/remote_specification.rb +++ b/lib/bundler/remote_specification.rb @@ -49,6 +49,13 @@ module Bundler # once the remote gem is downloaded, the backend specification will # be swapped out. def __swap__(spec) + without_type = proc {|d| Gem::Dependency.new(d.name, d.requirements_list) } + if (extra_deps = spec.runtime_dependencies.map(&without_type).-(dependencies.map(&without_type))) && extra_deps.any? + Bundler.ui.debug "#{full_name} from #{remote} has corrupted API dependencies (API returned #{dependencies}, real spec has (#{spec.runtime_dependencies}))" + raise APIResponseMismatchError, + "Downloading #{full_name} revealed dependencies not in the API (#{extra_deps.map(&without_type).map(&:to_s).join(", ")})." \ + "\nInstalling with `--full-index` should fix the problem." + end @_remote_specification = spec end |