diff options
author | James Wen <jrw2175@columbia.edu> | 2016-04-14 08:16:21 -0400 |
---|---|---|
committer | pivotal <pivotal@chambers.ny.pivotallabs.com> | 2016-04-14 12:24:24 -0400 |
commit | 762ddfaeb5e050112f5a78b30be4db1819d49670 (patch) | |
tree | 6d82f6bdf5dd59e0c276c497bba7d5de60d4e965 /lib/bundler/runtime.rb | |
parent | 3a09448d8b060f2688dbc73bfa1eb08e1bd126f3 (diff) | |
download | bundler-762ddfaeb5e050112f5a78b30be4db1819d49670.tar.gz |
Prevent recursive `bundle package` loop with multiple gemspecs
- Fixes #4430
Diffstat (limited to 'lib/bundler/runtime.rb')
-rw-r--r-- | lib/bundler/runtime.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index d4a78370..a0abb750 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -127,16 +127,16 @@ module Bundler Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}" - # Do not try to cache specification for the gem described by the .gemspec - root_gem_name = nil + # Do not try to cache specification for the gem described any of the gemspecs + root_gem_names = nil if gemspec_cache_hash = Bundler.instance_variable_get(:@gemspec_cache) - gemspec = gemspec_cache_hash.values.first - root_gem_name = gemspec.name unless gemspec.nil? + gemspecs = gemspec_cache_hash.values + root_gem_names = gemspecs.map(&:name) end specs.each do |spec| next if spec.name == "bundler" - next if !Dir.glob("*.gemspec").empty? && spec.source.class == Bundler::Source::Path && root_gem_name && spec.name == root_gem_name + next if !Dir.glob("*.gemspec").empty? && spec.source.class == Bundler::Source::Path && root_gem_names.include?(spec.name) spec.source.send(:fetch_gem, spec) if Bundler.settings[:cache_all_platforms] && spec.source.respond_to?(:fetch_gem, true) spec.source.cache(spec, custom_path) if spec.source.respond_to?(:cache) end |