diff options
-rw-r--r-- | .travis.yml | 21 | ||||
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 10 | ||||
-rw-r--r-- | lib/bundler/source.rb | 2 | ||||
-rw-r--r-- | lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb | 29 | ||||
-rw-r--r-- | lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb | 2 | ||||
-rw-r--r-- | man/bundle-config.ronn | 2 |
6 files changed, 58 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index b0c58af8ad..04a0edc27a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,11 +74,11 @@ matrix: - rvm: 1.9.3 env: RGV=v1.5.3 - # ALLOWED FAILURES # Ruby 1.8.7, Rubygems 1.3.6 and up - # since the great Travis image outage, frequent random segfaults :'( - rvm: 1.8.7 env: RGV=v2.2.5 + # ALLOWED FAILURES + # since the great Travis image outage, frequent random segfaults :'( - rvm: 1.8.7 env: RGV=v2.0.14 - rvm: 1.8.7 @@ -104,4 +104,21 @@ matrix: allow_failures: - rvm: 1.8.7 + env: RGV=v2.0.14 + - rvm: 1.8.7 + env: RGV=v1.8.29 + - rvm: 1.8.7 + env: RGV=v1.7.2 + - rvm: 1.8.7 + env: RGV=v1.6.2 + - rvm: 1.8.7 + env: RGV=v1.5.3 + - rvm: 1.8.7 + env: RGV=v1.4.2 + - rvm: 1.8.7 + env: RGV=v1.3.7 + - rvm: 1.8.7 + env: RGV=v1.3.6 + - rvm: 1.8.7 + env: RGV=v2.1.11 - rvm: ruby-head diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 7cd83e631e..53a153e560 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -8,6 +8,16 @@ end require "rubygems" require "rubygems/specification" + +begin + # Possible use in Gem::Specification#source below and require + # shouldn't be deferred. + require "rubygems/source" +rescue LoadError + # Not available before Rubygems 2.0.0, ignore + nil +end + require "bundler/match_platform" module Gem diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index b6f3a4311d..166c1d241c 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -14,7 +14,7 @@ module Bundler def version_message(spec) message = "#{spec.name} #{spec.version}" - message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY + message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY && !spec.platform.nil? if Bundler.locked_gems locked_spec = Bundler.locked_gems.specs.find {|s| s.name == spec.name } diff --git a/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb b/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb index 9ab2722f18..c063c6b4dc 100644 --- a/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb +++ b/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb @@ -3,6 +3,12 @@ require "pathname" require "set" class Bundler::CompactIndexClient + DEBUG_MUTEX = Mutex.new + def self.debug + return unless ENV["DEBUG_COMPACT_INDEX"] + DEBUG_MUTEX.synchronize { warn("[#{self}] #{yield}") } + end + class Error < StandardError; end require "bundler/vendor/compact_index_client/lib/compact_index_client/cache" @@ -28,17 +34,20 @@ class Bundler::CompactIndexClient end def names + Bundler::CompactIndexClient.debug { "/names" } update(@cache.names_path, "names") @cache.names end def versions + Bundler::CompactIndexClient.debug { "/versions" } update(@cache.versions_path, "versions") versions, @info_checksums_by_name = @cache.versions versions end def dependencies(names) + Bundler::CompactIndexClient.debug { "dependencies(#{names})" } in_parallel.call(names) do |name| update_info(name) @cache.dependencies(name).map {|d| d.unshift(name) } @@ -46,11 +55,13 @@ class Bundler::CompactIndexClient end def spec(name, version, platform = nil) + Bundler::CompactIndexClient.debug { "spec(name = #{name}, version = #{version}, platform = #{platform})" } update_info(name) @cache.specific_dependency(name, version, platform) end def update_and_parse_checksums! + Bundler::CompactIndexClient.debug { "update_and_parse_checksums!" } return @info_checksums_by_name if @parsed_checksums update(@cache.versions_path, "versions") @info_checksums_by_name = @cache.checksums @@ -60,15 +71,27 @@ class Bundler::CompactIndexClient private def update(local_path, remote_path) - return unless @endpoints.add?(remote_path) + Bundler::CompactIndexClient.debug { "update(#{local_path}, #{remote_path})" } + unless @endpoints.add?(remote_path) + Bundler::CompactIndexClient.debug { "already fetched #{remote_path}" } + return + end @updater.update(local_path, url(remote_path)) end def update_info(name) + Bundler::CompactIndexClient.debug { "update_info(#{name})" } path = @cache.info_path(name) checksum = @updater.checksum_for_file(path) - return unless existing = @info_checksums_by_name[name] - return if checksum == existing + unless existing = @info_checksums_by_name[name] + Bundler::CompactIndexClient.debug { "skipping updating info for #{name} since it is missing from versions" } + return + end + if checksum == existing + Bundler::CompactIndexClient.debug { "skipping updating info for #{name} since the versions checksum matches the local checksum" } + return + end + Bundler::CompactIndexClient.debug { "updating info for #{name} since the versions checksum #{existing} != the local checksum #{checksum}" } update(path, "info/#{name}") end diff --git a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb b/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb index 5c5ba41434..a410dd423c 100644 --- a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +++ b/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb @@ -50,7 +50,7 @@ class Bundler::CompactIndexClient mode = response.is_a?(Net::HTTPPartialContent) ? "a" : "w" local_temp_path.open(mode) {|f| f << content } - response_etag = response["ETag"] + response_etag = response["ETag"].gsub(%r{\AW/}, "") if etag_for(local_temp_path) == response_etag FileUtils.mv(local_temp_path, local_path) return diff --git a/man/bundle-config.ronn b/man/bundle-config.ronn index 3ea6d10973..dc701c584f 100644 --- a/man/bundle-config.ronn +++ b/man/bundle-config.ronn @@ -142,7 +142,7 @@ learn more about their operation in [bundle install(1)][bundle-install]. and key in PEM format. * `cache_path` (`BUNDLE_CACHE_PATH`): The directory that bundler will place cached gems in when running <code>bundle package</code>, and that bundler - will look in when installing gems. + will look in when installing gems. Defaults to `vendor/bundle`. * `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`): When set, Gemfiles containing multiple sources will produce errors instead of warnings. Use `bundle config --delete disable_multisource` to unset. |