keg_relocate: Don't relocate dylib IDs containing metavariables.
This commit is contained in:
parent
5a2a063802
commit
0f89f6520e
@ -78,13 +78,19 @@ class Keg
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filename_contains_metavariable?(fn)
|
||||||
|
fn =~ /^@(loader_|executable_|r)path/
|
||||||
|
end
|
||||||
|
|
||||||
def each_install_name_for(file, &block)
|
def each_install_name_for(file, &block)
|
||||||
dylibs = file.dynamically_linked_libraries
|
dylibs = file.dynamically_linked_libraries
|
||||||
dylibs.reject! { |fn| fn =~ /^@(loader_|executable_|r)path/ }
|
dylibs.reject! { |fn| filename_contains_metavariable?(fn) }
|
||||||
dylibs.each(&block)
|
dylibs.each(&block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def dylib_id_for(file)
|
def dylib_id_for(file)
|
||||||
|
return file.dylib_id if filename_contains_metavariable?(file.dylib_id)
|
||||||
|
|
||||||
# The new dylib ID should have the same basename as the old dylib ID, not
|
# The new dylib ID should have the same basename as the old dylib ID, not
|
||||||
# the basename of the file itself.
|
# the basename of the file itself.
|
||||||
basename = File.basename(file.dylib_id)
|
basename = File.basename(file.dylib_id)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user