Fix undefined method 'gsub' for nil (NoMethodError) in ConvenienceFunctions.libtoolize (#13700)

This commit is contained in:
Ed Reel
2025-12-04 17:28:32 -06:00
committed by GitHub
parent 3d727e4607
commit 350d535d02
2 changed files with 3 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ require 'etc'
require 'open3'
OLD_CREW_VERSION = defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
CREW_VERSION = '1.68.4' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
CREW_VERSION = '1.68.5' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
# Kernel architecture.
KERN_ARCH = Etc.uname[:machine]

View File

@@ -97,8 +97,8 @@ class ConvenienceFunctions
s.gsub!("#{CREW_LIB_PREFIX}/", '')
end
return if libnames.empty?
dlname = libnames.grep(/.so./).first
libname = dlname.gsub(/.so.\d+/, '')
dlname = libnames.grep(/.so(.)?/).first
libname = dlname.gsub(/.so(.\d+)?/, '')
longest_libname = libnames.max_by(&:length)
libvars = longest_libname.rpartition('.so.')[2].split('.')