From d911b5689a3e464f19b0756eb6eb4279d157cf53 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Fri, 11 Sep 2015 18:55:46 +0800 Subject: [PATCH] keg_relocate: split relocate_install_names and relocate_text_files For bottle with `:any_skip_relocation`, relocating text files is required. --- Library/Homebrew/cmd/bottle.rb | 2 ++ Library/Homebrew/formula_installer.rb | 2 ++ Library/Homebrew/keg_relocate.rb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index 156860b506..3a95759cde 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -169,6 +169,8 @@ module Homebrew begin keg.relocate_install_names prefix, Keg::PREFIX_PLACEHOLDER, cellar, Keg::CELLAR_PLACEHOLDER, :keg_only => f.keg_only? + keg.relocate_text_files prefix, Keg::PREFIX_PLACEHOLDER, + cellar, Keg::CELLAR_PLACEHOLDER keg.delete_pyc_files! cd cellar do diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index f9c1ae42aa..62637d2ee2 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -708,6 +708,8 @@ class FormulaInstaller keg.relocate_install_names Keg::PREFIX_PLACEHOLDER, HOMEBREW_PREFIX.to_s, Keg::CELLAR_PLACEHOLDER, HOMEBREW_CELLAR.to_s, :keg_only => formula.keg_only? end + keg.relocate_text_files Keg::PREFIX_PLACEHOLDER, HOMEBREW_PREFIX.to_s, + Keg::CELLAR_PLACEHOLDER, HOMEBREW_CELLAR.to_s Pathname.glob("#{formula.bottle_prefix}/{etc,var}/**/*") do |path| path.extend(InstallRenamed) diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 963f219ba8..7a2636dff7 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -46,7 +46,9 @@ class Keg end end end + end + def relocate_text_files(old_prefix, new_prefix, old_cellar, new_cellar) files = text_files | libtool_files files.group_by { |f| f.stat.ino }.each_value do |first, *rest|