extend/os/linux/install: update old ld.so symlinks

This commit is contained in:
Bo Anderson 2022-09-19 03:34:05 +01:00
parent 07f5951b76
commit 88ca45002d
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -64,14 +64,19 @@ module Homebrew
def symlink_ld_so
brew_ld_so = HOMEBREW_PREFIX/"lib/ld.so"
return if brew_ld_so.readable?
ld_so = HOMEBREW_PREFIX/"opt/glibc/lib/ld-linux-x86-64.so.2"
unless ld_so.readable?
ld_so = DYNAMIC_LINKERS.find { |s| File.executable? s }
raise "Unable to locate the system's dynamic linker" unless ld_so
if ld_so.blank?
raise "Unable to locate the system's dynamic linker" unless brew_ld_so.readable?
return
end
end
return if brew_ld_so.readable? && (brew_ld_so.readlink == ld_so)
FileUtils.mkdir_p HOMEBREW_PREFIX/"lib"
FileUtils.ln_sf ld_so, brew_ld_so
end