From 38b4a06207240f84c8c9ff5c92fccc86143e570c Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 16 Jan 2012 19:37:37 +0000 Subject: [PATCH] Don't bottle unless built with correct flag. Closes Homebrew/homebrew#9350. Signed-off-by: Mike McQuaid --- Library/Contributions/examples/brew-bottle.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Library/Contributions/examples/brew-bottle.rb b/Library/Contributions/examples/brew-bottle.rb index 4d91643e09..fc1faa4ed5 100755 --- a/Library/Contributions/examples/brew-bottle.rb +++ b/Library/Contributions/examples/brew-bottle.rb @@ -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}"