aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2012-01-16 19:37:37 +0000
committerMike McQuaid2012-01-16 21:05:00 +0000
commit38b4a06207240f84c8c9ff5c92fccc86143e570c (patch)
tree1baf4f66f0d5ea1b57ebd215496eb2dfbfa23585 /Library
parent8b762cd9b491478363ee5b07e2ef89e270865216 (diff)
downloadbrew-38b4a06207240f84c8c9ff5c92fccc86143e570c.tar.bz2
Don't bottle unless built with correct flag.
Closes Homebrew/homebrew#9350. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/examples/brew-bottle.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/Library/Contributions/examples/brew-bottle.rb b/Library/Contributions/examples/brew-bottle.rb
index 4d91643e0..fc1faa4ed 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}"