summaryrefslogtreecommitdiff
path: root/lib/bundler/runtime.rb
diff options
context:
space:
mode:
authorJames Wen <jrw2175@columbia.edu>2016-03-25 14:01:41 -0400
committerJames Wen <jrw2175@columbia.edu>2016-03-25 14:01:41 -0400
commitff3ba7f1d53b504fe1d8ae1613466626065cf2a6 (patch)
treec74d9f6086e6c2dd7cfb25d00807d34e68122b74 /lib/bundler/runtime.rb
parent83350e3693c5ed5dd7e55916411e5c2c877548d3 (diff)
downloadbundler-ff3ba7f1d53b504fe1d8ae1613466626065cf2a6.tar.gz
Prevent endless recursive copy for `bundle package --all` and
differently named gemspecs and gems - Fixes #4392
Diffstat (limited to 'lib/bundler/runtime.rb')
-rw-r--r--lib/bundler/runtime.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index e80a9eaeba..d4a7837072 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -133,9 +133,10 @@ module Bundler
gemspec = gemspec_cache_hash.values.first
root_gem_name = gemspec.name unless gemspec.nil?
end
+
specs.each do |spec|
next if spec.name == "bundler"
- next if File.exist?("#{root_gem_name}.gemspec") && 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_name && spec.name == root_gem_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