diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-03-10 12:08:20 +0900 |
---|---|---|
committer | NARUSE, Yui <nurse@users.noreply.github.com> | 2021-03-11 17:24:52 +0900 |
commit | 0476ce0370c1ee56de690d43c15d5e8d7893dedd (patch) | |
tree | 72590a5a0211c53d431cfab4e3b008dbcc3df6e8 /lib/rubygems | |
parent | 7efc7afcae6720e1af7ab49986d789b6f9d6fe0a (diff) |
Merge RubyGems-3.2.14 and Bundler-2.2.14
Diffstat (limited to 'lib/rubygems')
-rw-r--r-- | lib/rubygems/platform.rb | 10 | ||||
-rw-r--r-- | lib/rubygems/remote_fetcher.rb | 11 |
2 files changed, 6 insertions, 15 deletions
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb index e01d0494d6..fd1c0a62ac 100644 --- a/lib/rubygems/platform.rb +++ b/lib/rubygems/platform.rb @@ -66,7 +66,7 @@ class Gem::Platform when String then arch = arch.split '-' - if arch.length > 2 and arch.last !~ /\d+(\.\d+)?$/ # reassemble x86-linux-{libc} + if arch.length > 2 and arch.last !~ /\d/ # reassemble x86-linux-gnu extra = arch.pop arch.last << "-#{extra}" end @@ -146,8 +146,7 @@ class Gem::Platform ## # Does +other+ match this platform? Two platforms match if they have the # same CPU, or either has a CPU of 'universal', they have the same OS, and - # they have the same version, or either has no version (except for 'linux' - # where the version is the libc name, with no version standing for 'gnu') + # they have the same version, or either has no version. # # Additionally, the platform will match if the local CPU is 'arm' and the # other CPU starts with "arm" (for generic ARM family support). @@ -163,10 +162,7 @@ class Gem::Platform @os == other.os and # version - ( - (@os != 'linux' and (@version.nil? or other.version.nil?)) or - @version == other.version - ) + (@version.nil? or other.version.nil? or @version == other.version) end ## diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb index 7ac334d30d..da7b46e06e 100644 --- a/lib/rubygems/remote_fetcher.rb +++ b/lib/rubygems/remote_fetcher.rb @@ -51,6 +51,7 @@ class Gem::RemoteFetcher class UnknownHostError < FetchError end + deprecate_constant(:UnknownHostError) @fetcher = nil @@ -262,15 +263,9 @@ class Gem::RemoteFetcher end data - rescue Timeout::Error - raise UnknownHostError.new('timed out', uri) - rescue IOError, SocketError, SystemCallError, + rescue Timeout::Error, IOError, SocketError, SystemCallError, *(OpenSSL::SSL::SSLError if Gem::HAVE_OPENSSL) => e - if e.message =~ /getaddrinfo/ - raise UnknownHostError.new('no such name', uri) - else - raise FetchError.new("#{e.class}: #{e}", uri) - end + raise FetchError.new("#{e.class}: #{e}", uri) end def fetch_s3(uri, mtime = nil, head = false) |