From 8252ea214061e1e8601ecfe178d010ed92ee8600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 28 Sep 2022 12:12:13 +0200 Subject: [rubygems/rubygems] Fix matching of linux platforms with eabi modifiers https://github.com/rubygems/rubygems/commit/89362c18ef Co-authored-by: Mike Dalessio --- lib/bundler/rubygems_ext.rb | 8 ++++---- lib/rubygems/platform.rb | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 201d2fef17..1747b7cf22 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -261,7 +261,7 @@ module Gem # version ( (@os != "linux" && (@version.nil? || other.version.nil?)) || - (@os == "linux" && (normalized_linux_version_ext == other.normalized_linux_version_ext || other.version == "musl#{@version}")) || + (@os == "linux" && (normalized_linux_version_ext == other.normalized_linux_version_ext || other.version == "musl#{@version}" || other.version == "musleabi#{@version}")) || @version == other.version ) end @@ -271,10 +271,10 @@ module Gem def normalized_linux_version_ext return nil unless @version - without_gnu = @version.sub(/\Agnu/, "") - return nil if without_gnu.empty? + without_gnu_nor_abi_modifiers = @version.sub(/\Agnu/, "").sub(/eabi\Z/, "") + return nil if without_gnu_nor_abi_modifiers.empty? - without_gnu + without_gnu_nor_abi_modifiers end end end diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb index 1144879f9c..0935fd8971 100644 --- a/lib/rubygems/platform.rb +++ b/lib/rubygems/platform.rb @@ -181,7 +181,7 @@ class Gem::Platform # version ( (@os != "linux" && (@version.nil? || other.version.nil?)) || - (@os == "linux" && (normalized_linux_version == other.normalized_linux_version || other.version == "musl#{@version}")) || + (@os == "linux" && (normalized_linux_version == other.normalized_linux_version || other.version == "musl#{@version}" || other.version == "musleabi#{@version}")) || @version == other.version ) end @@ -189,10 +189,10 @@ class Gem::Platform def normalized_linux_version return nil unless @version - without_gnu = @version.sub(/\Agnu/, "") - return nil if without_gnu.empty? + without_gnu_nor_abi_modifiers = @version.sub(/\Agnu/, "").sub(/eabi\Z/, "") + return nil if without_gnu_nor_abi_modifiers.empty? - without_gnu + without_gnu_nor_abi_modifiers end ## -- cgit v1.2.3