Implement ruby-macho TODOs
We now have the new release of ruby-macho (#15758), so we can now finish off the remaining work from #15731.
This commit is contained in:
parent
ccf0caffab
commit
6b728bf3bd
@ -59,8 +59,6 @@ class Keg
|
|||||||
new_name = opt_name_for(bad_name)
|
new_name = opt_name_for(bad_name)
|
||||||
loader_name = loader_name_for(file, new_name)
|
loader_name = loader_name_for(file, new_name)
|
||||||
next if loader_name == bad_name
|
next if loader_name == bad_name
|
||||||
# TODO: Remove the line below on the next release of ruby-macho. See Homebrew/ruby-macho@e9eaa75.
|
|
||||||
next if file.rpaths(resolve_variable_references: false).include?(loader_name)
|
|
||||||
|
|
||||||
change_rpath(bad_name, loader_name, file)
|
change_rpath(bad_name, loader_name, file)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -64,11 +64,11 @@ module MachOShim
|
|||||||
resolve_variable_name(r.path.to_s) == resolve_variable_name(rpath)
|
resolve_variable_name(r.path.to_s) == resolve_variable_name(rpath)
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO: Add `last: true` to `options` and replace `delete_command` with `delete_rpath`
|
# Delete the last instance to avoid changing the order in which rpaths are searched.
|
||||||
# when the PR linked below is merged and release for ruby-macho.
|
rpath_to_delete = candidates.last.path.to_s
|
||||||
# https://github.com/Homebrew/ruby-macho/pull/555
|
options[:last] = true
|
||||||
command_to_delete = candidates.last # .path.to_s (when switching to `MachOFile#delete_rpath`)
|
|
||||||
macho.delete_command(command_to_delete, options)
|
macho.delete_rpath(rpath_to_delete, options)
|
||||||
macho.write!
|
macho.write!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user