diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-03-08 12:17:52 +0900 |
---|---|---|
committer | NARUSE, Yui <nurse@users.noreply.github.com> | 2021-03-11 17:24:52 +0900 |
commit | 7efc7afcae6720e1af7ab49986d789b6f9d6fe0a (patch) | |
tree | cfc13bbb77911924b689147c74947ec0850eded1 /lib/rubygems/platform.rb | |
parent | 06cd5711e0afc6302052e847863a7fdcc42fe692 (diff) |
Merge RubyGems-3.2.13 and Bundler-2.2.13
Diffstat (limited to 'lib/rubygems/platform.rb')
-rw-r--r-- | lib/rubygems/platform.rb | 10 |
1 files changed, 7 insertions, 3 deletions
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 ## |