keg_relocate: relocate libtool files

This commit is contained in:
Xu Cheng 2015-07-23 16:29:37 +08:00
parent fd7f3b9496
commit de6a9ff055

View File

@ -38,7 +38,9 @@ class Keg
end
end
text_files.group_by { |f| f.stat.ino }.each_value do |first, *rest|
files = text_files | libtool_files
files.group_by { |f| f.stat.ino }.each_value do |first, *rest|
s = first.open("rb", &:read)
changed = s.gsub!(old_cellar, new_cellar)
changed = s.gsub!(old_prefix, new_prefix) || changed
@ -171,4 +173,15 @@ class Keg
text_files
end
def libtool_files
libtool_files = []
# find .la files, which are stored in lib/
lib.find do |pn|
next if pn.symlink? or pn.directory? or pn.extname != '.la'
libtool_files << pn
end if lib.directory?
libtool_files
end
end