26 lines
827 B
Ruby
Raw Normal View History

# Builds binary brew package
require 'cmd/install'
Homebrew.install_formulae ARGV.formulae
destination = HOMEBREW_PREFIX + "Bottles"
if not File.directory?(destination)
2010-12-01 23:01:54 +00:00
Dir.mkdir destination
end
ARGV.each do|formula|
2010-12-01 23:01:54 +00:00
# Get the latest version
version = `brew list --versions #{formula}`.split.last
source = HOMEBREW_CELLAR + formula + version
filename = formula + '-' + version + '-bottle.tar.gz'
2010-12-01 23:01:54 +00:00
ohai "Bottling #{formula} #{version}..."
HOMEBREW_CELLAR.cd do
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
# or an uncompressed tarball (and more bandwidth friendly).
safe_system 'tar', 'czf', "#{destination}/#{filename}", "#{formula}/#{version}"
2011-06-22 19:11:45 +01:00
sha1 = Pathname.new("#{destination}/#{filename}").sha1
ohai "Bottled #{filename}"
ohai "SHA1 #{sha1}"
2010-12-01 23:01:54 +00:00
end
2010-12-02 01:13:41 +00:00
end