From de6a9ff055f9f691f132b03d297268590a42a541 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Thu, 23 Jul 2015 16:29:37 +0800 Subject: [PATCH] keg_relocate: relocate libtool files --- Library/Homebrew/keg_relocate.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 04e542141d..1541d4695e 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -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