summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-04-21 17:17:02 +0000
committerSamuel Giddins <segiddins@segiddins.me>2017-04-23 10:35:52 +0200
commit12ac56c253957cd3576b7f2c7994ef69122b0de9 (patch)
tree2077d9b416120418b43b6e72952f0f44e5c27f0f
parent5f413243819568029a630c1e02c541efdd4d9b5d (diff)
downloadbundler-12ac56c253957cd3576b7f2c7994ef69122b0de9.tar.gz
Auto merge of #5600 - bundler:seg-lockfile-duplicates, r=segiddins
Avoid duplicating specs in the lockfile after updating w/ the gem uninstalled Closes https://github.com/bundler/bundler/issues/5599 I decided to not compare using `full_name` in `SpecSet#merge` for the sake of performance, since `#full_name` is uncached (cherry picked from commit 8e2cd4ac9b1b0c3459b5969af364b318821121e5)
-rw-r--r--lib/bundler/lazy_specification.rb2
-rw-r--r--spec/install/gems/compact_index_spec.rb12
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index 9a8268a2d5..8d9a02c2b8 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -29,7 +29,7 @@ module Bundler
@name = name
@version = version
@dependencies = []
- @platform = platform
+ @platform = platform || Gem::Platform::RUBY
@source = source
@specification = nil
end
diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb
index 87f59e32c8..6f35a50226 100644
--- a/spec/install/gems/compact_index_spec.rb
+++ b/spec/install/gems/compact_index_spec.rb
@@ -769,4 +769,16 @@ Bundler::APIResponseMismatchError: Downloading rails-2.3.2 revealed dependencies
Either installing with `--full-index` or running `bundle update rails` should fix the problem.
E
end
+
+ it "does not duplicate specs in the lockfile when updating and a dependency is not installed" do
+ install_gemfile! <<-G, :artifice => "compact_index"
+ source "#{source_uri}" do
+ gem "rails"
+ gem "activemerchant"
+ end
+ G
+ gem_command! :uninstall, "activemerchant"
+ bundle! "update rails", :artifice => "compact_index"
+ expect(lockfile.scan(/activemerchant \(/).size).to eq(1)
+ end
end