diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2022-09-28 10:57:54 +0200 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-10-01 05:46:39 +0900 |
commit | 4d58ee3de0ecf8a3b3201359f3c593142cf92d7b (patch) | |
tree | 3f132540f19e29c70bcc79cd13669d5b99d272ab /lib/bundler | |
parent | 850cfb021e2ee679bc62d3edc2246e5196630059 (diff) |
[rubygems/rubygems] Refactor platform matching on Linux
I think this highlights better how musl is special.
https://github.com/rubygems/rubygems/commit/4075771697
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 8b46d7ece4..201d2fef17 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -261,10 +261,21 @@ module Gem # version ( (@os != "linux" && (@version.nil? || other.version.nil?)) || - (@os == "linux" && (other.version == "gnu#{@version}" || other.version == "musl#{@version}" || @version == "gnu#{other.version}")) || + (@os == "linux" && (normalized_linux_version_ext == other.normalized_linux_version_ext || other.version == "musl#{@version}")) || @version == other.version ) end + + # This is a copy of RubyGems 3.3.23 or higher `normalized_linux_method`. + # Once only 3.3.23 is supported, we can use the method in RubyGems. + def normalized_linux_version_ext + return nil unless @version + + without_gnu = @version.sub(/\Agnu/, "") + return nil if without_gnu.empty? + + without_gnu + end end end |