summaryrefslogtreecommitdiff
path: root/lib/rubygems/platform.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2021-02-01 16:17:16 +0100
committerHiroshi SHIBATA <[email protected]>2021-03-08 13:47:35 +0900
commit53468cc11147b0d285fc376fc546b677dad600ca (patch)
treeeb9c97f544d089be2d324126b025b11f41a22c90 /lib/rubygems/platform.rb
parent2ab6b7a7516e1b2c48a66ce513afabb62d101461 (diff)
Sync latest development version of bundler & rubygems
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4143
Diffstat (limited to 'lib/rubygems/platform.rb')
-rw-r--r--lib/rubygems/platform.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
index a500fd24c8..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
@@ -121,10 +121,6 @@ class Gem::Platform
end
end
- def inspect
- "%s @cpu=%p, @os=%p, @version=%p>" % [super[0..-2], *to_a]
- end
-
def to_a
[@cpu, @os, @version]
end
@@ -150,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).
@@ -166,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
##