[DRE-commits] [bundler] 12/14: d/patches/dont-check-if-latest: block network check (closes: #882361)

Samuel Henrique samueloph-guest at moszumanska.debian.org
Fri Dec 29 01:36:16 UTC 2017


This is an automated email from the git hooks/post-receive script.

samueloph-guest pushed a commit to branch master
in repository bundler.

commit f4bcf8460e2a645dffc9464b8db8626d10e2d3d0
Author: Samuel Henrique <samueloph at gmail.com>
Date:   Thu Dec 28 23:15:46 2017 -0200

    d/patches/dont-check-if-latest: block network check (closes: #882361)
---
 debian/patches/dont-check-if-latest-version | 70 +++++++++++++++++++++++++++++
 debian/patches/series                       |  1 +
 2 files changed, 71 insertions(+)

diff --git a/debian/patches/dont-check-if-latest-version b/debian/patches/dont-check-if-latest-version
new file mode 100644
index 0000000..b0e64e6
--- /dev/null
+++ b/debian/patches/dont-check-if-latest-version
@@ -0,0 +1,70 @@
+Description: block "phone call" to check if latest release (closes: #882361)
+
+ This is not the ideal solution yet, as it does not let the user unset
+ disable_version_check to force-check. Should be fixed
+Author: Samuel Henrique <samueloph at gmail.com>
+Index: bundler/lib/bundler/cli.rb
+===================================================================
+--- bundler.orig/lib/bundler/cli.rb
++++ bundler/lib/bundler/cli.rb
+@@ -712,33 +712,33 @@ module Bundler
+     end
+ 
+     def warn_on_outdated_bundler
+-      return if Bundler.settings[:disable_version_check]
+-
+-      command_name = current_command.name
+-      return if PARSEABLE_COMMANDS.include?(command_name)
+-
+-      latest = Fetcher::CompactIndex.
+-               new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
+-               send(:compact_index_client).
+-               instance_variable_get(:@cache).
+-               dependencies("bundler").
+-               map {|d| Gem::Version.new(d.first) }.
+-               max
+-      return unless latest
+-
+-      current = Gem::Version.new(VERSION)
+-      return if current >= latest
+-      latest_installed = Bundler.rubygems.find_name("bundler").map(&:version).max
+-
+-      installation = "To install the latest version, run `gem install bundler#{" --pre" if latest.prerelease?}`"
+-      if latest_installed && latest_installed > current
+-        suggestion = "To update to the most recent installed version (#{latest_installed}), run `bundle update --bundler`"
+-        suggestion = "#{installation}\n#{suggestion}" if latest_installed < latest
+-      else
+-        suggestion = installation
+-      end
+-
+-      Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\n#{suggestion}"
++#      return if Bundler.settings[:disable_version_check]
++#
++#      command_name = current_command.name
++#      return if PARSEABLE_COMMANDS.include?(command_name)
++#
++#      latest = Fetcher::CompactIndex.
++#               new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
++#               send(:compact_index_client).
++#               instance_variable_get(:@cache).
++#               dependencies("bundler").
++#               map {|d| Gem::Version.new(d.first) }.
++#               max
++#      return unless latest
++#
++#      current = Gem::Version.new(VERSION)
++#      return if current >= latest
++#      latest_installed = Bundler.rubygems.find_name("bundler").map(&:version).max
++#
++#      installation = "To install the latest version, run `gem install bundler#{" --pre" if latest.prerelease?}`"
++#      if latest_installed && latest_installed > current
++#        suggestion = "To update to the most recent installed version (#{latest_installed}), run `bundle update --bundler`"
++#        suggestion = "#{installation}\n#{suggestion}" if latest_installed < latest
++#      else
++#        suggestion = installation
++#      end
++#
++#      Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\n#{suggestion}"
+     rescue
+       nil
+     end
diff --git a/debian/patches/series b/debian/patches/series
index 244240c..d7df6de 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ no-git-in-gemspec
 unvendorize
 do-not-add-system-path-to-RUBYLIB
 manpage-typo
+dont-check-if-latest-version

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/bundler.git



More information about the Pkg-ruby-extras-commits mailing list