Don't bottle unless built with correct flag.

Closes Homebrew/homebrew#9350.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2012-01-16 19:37:37 +00:00
parent 8b762cd9b4
commit 38b4a06207

View File

@ -1,5 +1,5 @@
# Builds binary brew package
require 'cmd/install'
require 'tab'
ARGV.each do|formula|
# Get the latest version
@ -12,9 +12,16 @@ ARGV.each do|formula|
source = HOMEBREW_CELLAR + formula + version
filename = "#{formula}-#{version}-bottle.tar.gz"
ohai "Bottling #{formula} #{version}..."
destination = Pathname.pwd
tab = Tab.for_keg source
if not tab.built_bottle
onoe "Formula not installed with '--build-bottle': #{formula}"
next
end
HOMEBREW_CELLAR.cd do
ohai "Bottling #{formula} #{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', destination/filename, "#{formula}/#{version}"