summaryrefslogtreecommitdiff
path: root/lib/rubygems
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-03-08 12:17:52 +0900
committerNARUSE, Yui <nurse@users.noreply.github.com>2021-03-11 17:24:52 +0900
commit7efc7afcae6720e1af7ab49986d789b6f9d6fe0a (patch)
treecfc13bbb77911924b689147c74947ec0850eded1 /lib/rubygems
parent06cd5711e0afc6302052e847863a7fdcc42fe692 (diff)
Merge RubyGems-3.2.13 and Bundler-2.2.13
Diffstat (limited to 'lib/rubygems')
-rw-r--r--lib/rubygems/core_ext/tcpsocket_init.rb5
-rw-r--r--lib/rubygems/platform.rb10
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/rubygems/core_ext/tcpsocket_init.rb b/lib/rubygems/core_ext/tcpsocket_init.rb
index 3275c58112..3d9740c579 100644
--- a/lib/rubygems/core_ext/tcpsocket_init.rb
+++ b/lib/rubygems/core_ext/tcpsocket_init.rb
@@ -13,12 +13,13 @@ module CoreExtensions
def initialize(host, serv, *rest)
mutex = Mutex.new
addrs = []
+ threads = []
cond_var = ConditionVariable.new
Addrinfo.foreach(host, serv, nil, :STREAM) do |addr|
Thread.report_on_exception = false if defined? Thread.report_on_exception = ()
- Thread.new(addr) do
+ threads << Thread.new(addr) do
# give head start to ipv6 addresses
sleep IPV4_DELAY_SECONDS if addr.ipv4?
@@ -40,6 +41,8 @@ module CoreExtensions
host = addrs.shift unless addrs.empty?
end
+ threads.each {|t| t.kill.join if t.alive? }
+
super(host, serv, *rest)
end
end
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
index fd1c0a62ac..e01d0494d6 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/ # reassemble x86-linux-gnu
+ if arch.length > 2 and arch.last !~ /\d+(\.\d+)?$/ # reassemble x86-linux-{libc}
extra = arch.pop
arch.last << "-#{extra}"
end
@@ -146,7 +146,8 @@ 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.
+ # 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')
#
# Additionally, the platform will match if the local CPU is 'arm' and the
# other CPU starts with "arm" (for generic ARM family support).
@@ -162,7 +163,10 @@ class Gem::Platform
@os == other.os and
# version
- (@version.nil? or other.version.nil? or @version == other.version)
+ (
+ (@os != 'linux' and (@version.nil? or other.version.nil?)) or
+ @version == other.version
+ )
end
##