keg_relocate: style improvements

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Carlo Cabrera 2021-05-06 11:52:18 +01:00 committed by cnnrmnn
parent 6156fadd65
commit 1d70c28178

View File

@ -38,10 +38,10 @@ class Keg
if ENV["HOMEBREW_RELOCATE_RPATHS"] if ENV["HOMEBREW_RELOCATE_RPATHS"]
each_rpath_for(file) do |old_name| each_rpath_for(file) do |old_name|
if old_name.start_with? relocation.old_cellar new_name = if old_name.start_with? relocation.old_cellar
new_name = old_name.sub(relocation.old_cellar, relocation.new_cellar) old_name.sub(relocation.old_cellar, relocation.new_cellar)
elsif old_name.start_with? relocation.old_prefix elsif old_name.start_with? relocation.old_prefix
new_name = old_name.sub(relocation.old_prefix, relocation.new_prefix) old_name.sub(relocation.old_prefix, relocation.new_prefix)
end end
change_rpath(old_name, new_name, file) if new_name change_rpath(old_name, new_name, file) if new_name
@ -125,7 +125,7 @@ class Keg
def each_rpath_for(file, &block) def each_rpath_for(file, &block)
rpaths = file.rpaths rpaths = file.rpaths
rpaths.reject! { |fn| fn =~ /^@(loader|executable)_path/ } .reject { |fn| fn =~ /^@(loader|executable)_path/ }
rpaths.each(&block) rpaths.each(&block)
end end