aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMike McQuaid2013-02-28 22:14:59 +0000
committerMike McQuaid2013-03-01 17:49:09 +0000
commit20c0ddc40100b08f26d274c550ab0051d9831d21 (patch)
tree830de4cde08dc822678bc48b9b607baf48c27d1c /Library/Homebrew/cmd
parent22aec1d0d97ee20fdc31e2df278378fe17f9d07f (diff)
downloadbrew-20c0ddc40100b08f26d274c550ab0051d9831d21.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.rb10
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"