From 28f19878e3a0b9c38d1be02f3adef7043547de58 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Sat, 26 Oct 2024 06:31:05 +0100 Subject: [PATCH] keg_relocate: fix error when dylib_id doesn't need changing --- Library/Homebrew/extend/os/mac/keg_relocate.rb | 3 ++- Library/Homebrew/keg_relocate.rb | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index 31494e2dd2..b97dbe075d 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -28,7 +28,7 @@ module OS if file.dylib? id = relocated_name_for(file.dylib_id, relocation) - modified = change_dylib_id(id, file) + modified = change_dylib_id(id, file) if id needs_codesigning ||= modified end @@ -148,6 +148,7 @@ module OS (opt_record/relative_dirname/basename).to_s end + sig { params(old_name: String, relocation: ::Keg::Relocation).returns(T.nilable(String)) } def relocated_name_for(old_name, relocation) old_prefix, new_prefix = relocation.replacement_pair_for(:prefix) old_cellar, new_cellar = relocation.replacement_pair_for(:cellar) diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 04a2fc3c00..5ae085f769 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -15,7 +15,7 @@ class Keg RELOCATABLE_PATH_REGEX_PREFIX = /(?:(?<=-F|-I|-L|-isystem)|(?