diff options
| author | Mike McQuaid | 2013-02-28 22:14:59 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2013-03-01 17:49:09 +0000 |
| commit | 82ecb69a53166c8c2fa0e507ac32c86241b66343 (patch) | |
| tree | 95a887b2946c11ced021b77c0dbbc7f70f39beaa /Library/Homebrew/cmd | |
| parent | d1cd6b2d86c157c390e8e3d1c373deaabbd65301 (diff) | |
| download | homebrew-82ecb69a53166c8c2fa0e507ac32c86241b66343.tar.bz2 | |
Add non-/usr/local bottles support.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/bottle.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index 87b380aa6..cda1d776d 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -20,12 +20,22 @@ module Homebrew extend self HOMEBREW_CELLAR.cd do ohai "Bottling #{f.name} #{f.version}..." + bottle_relocatable = !quiet_system( + 'grep', '--recursive', '--quiet', '--max-count=1', + HOMEBREW_CELLAR, "#{f.name}/#{f.version}") + cellar = nil + if bottle_relocatable + cellar = ':any' + elsif HOMEBREW_CELLAR.to_s != '/usr/local/Cellar' + cellar = "'#{HOMEBREW_CELLAR}'" + end # Use gzip, faster to compress than bzip2, faster to uncompress than bzip2 # or an uncompressed tarball (and more bandwidth friendly). safe_system 'tar', 'czf', bottle_path, "#{f.name}/#{f.version}" sha1 = bottle_path.sha1 puts "./#{filename}" puts "bottle do" + puts " cellar #{cellar}" if cellar puts " revision #{bottle_revision}" if bottle_revision > 0 puts " sha1 '#{sha1}' => :#{MacOS.cat}" puts "end" |
