bottle: add --skip-relocation flag to skip keg relocate

This flag is indented to be used in `homebrew/portable` to build vendor
ruby/git/curl.
This commit is contained in:
Xu Cheng 2016-06-28 15:33:22 +08:00
parent a2681d196f
commit d4e8d3df0a
No known key found for this signature in database
GPG Key ID: C2A3860FA0B459CE

View File

@ -194,10 +194,12 @@ module Homebrew
original_tab = nil
begin
keg.relocate_install_names prefix, Keg::PREFIX_PLACEHOLDER,
cellar, Keg::CELLAR_PLACEHOLDER
keg.relocate_text_files prefix, Keg::PREFIX_PLACEHOLDER,
cellar, Keg::CELLAR_PLACEHOLDER
unless ARGV.include? "--skip-relocation"
keg.relocate_install_names prefix, Keg::PREFIX_PLACEHOLDER,
cellar, Keg::CELLAR_PLACEHOLDER
keg.relocate_text_files prefix, Keg::PREFIX_PLACEHOLDER,
cellar, Keg::CELLAR_PLACEHOLDER
end
keg.delete_pyc_files!
@ -246,9 +248,14 @@ module Homebrew
ignores << %r{#{HOMEBREW_CELLAR}/go/[\d\.]+/libexec}
end
relocatable = !keg_contains(prefix_check, keg, ignores)
relocatable = !keg_contains(cellar, keg, ignores) && relocatable
skip_relocation = relocatable && !keg.require_install_name_tool?
if ARGV.include? "--skip-relocation"
relocatable = true
skip_relocation = true
else
relocatable = !keg_contains(prefix_check, keg, ignores)
relocatable = !keg_contains(cellar, keg, ignores) && relocatable
skip_relocation = relocatable && !keg.require_install_name_tool?
end
puts if !relocatable && ARGV.verbose?
rescue Interrupt
ignore_interrupts { bottle_path.unlink if bottle_path.exist? }
@ -256,10 +263,12 @@ module Homebrew
ensure
ignore_interrupts do
original_tab.write if original_tab
keg.relocate_install_names Keg::PREFIX_PLACEHOLDER, prefix,
Keg::CELLAR_PLACEHOLDER, cellar
keg.relocate_text_files Keg::PREFIX_PLACEHOLDER, prefix,
Keg::CELLAR_PLACEHOLDER, cellar
unless ARGV.include? "--skip-relocation"
keg.relocate_install_names Keg::PREFIX_PLACEHOLDER, prefix,
Keg::CELLAR_PLACEHOLDER, cellar
keg.relocate_text_files Keg::PREFIX_PLACEHOLDER, prefix,
Keg::CELLAR_PLACEHOLDER, cellar
end
end
end
end