diff options
| author | Xu Cheng | 2016-06-28 15:33:22 +0800 |
|---|---|---|
| committer | Xu Cheng | 2016-06-30 15:26:04 +0800 |
| commit | d4e8d3df0a121ec97d2a1c7e872e6c570106ee9a (patch) | |
| tree | daf6d0d9870ec041170eea8ce0e251bcf0bf7c71 /Library/Homebrew | |
| parent | a2681d196fe91d53f67d3eaea03cb2313db6b751 (diff) | |
| download | brew-d4e8d3df0a121ec97d2a1c7e872e6c570106ee9a.tar.bz2 | |
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.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/bottle.rb | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index 8581d0a95..1975d7ccf 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -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 |
