2012-03-07 17:29:05 -05:00
|
|
|
require 'formula'
|
2012-03-07 21:30:03 -05:00
|
|
|
require 'bottles'
|
2012-03-07 17:29:05 -05:00
|
|
|
require 'tab'
|
|
|
|
|
|
|
|
module Homebrew extend self
|
|
|
|
def bottle_formula f
|
|
|
|
return onoe "Formula not installed: #{f.name}" unless f.installed?
|
2012-03-07 21:30:03 -05:00
|
|
|
return onoe "Formula not installed with '--build-bottle': #{f.name}" unless built_bottle? f
|
2012-03-07 17:29:05 -05:00
|
|
|
|
|
|
|
directory = Pathname.pwd
|
2012-03-07 21:30:03 -05:00
|
|
|
filename = bottle_filename f
|
2012-03-07 17:29:05 -05:00
|
|
|
|
|
|
|
HOMEBREW_CELLAR.cd do
|
|
|
|
ohai "Bottling #{f.name} #{f.version}..."
|
|
|
|
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
|
|
|
|
# or an uncompressed tarball (and more bandwidth friendly).
|
|
|
|
safe_system 'tar', 'czf', directory/filename, "#{f.name}/#{f.version}"
|
|
|
|
puts "./#{filename}"
|
|
|
|
puts "bottle do"
|
|
|
|
puts " url 'https://downloads.sf.net/project/machomebrew/Bottles/#{filename}'"
|
|
|
|
puts " sha1 '#{(directory/filename).sha1}'"
|
|
|
|
puts "end"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def bottle
|
|
|
|
ARGV.formulae.each do|f|
|
|
|
|
bottle_formula Formula.factory f
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|