aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2010-11-24 09:38:09 +0000
committerMike McQuaid2010-11-24 09:38:09 +0000
commitd688fa310a73c6fb5400293bfaffc989795d4f36 (patch)
tree03c87dfd0cadaa4f3212603737f36bed875824e3 /Library
parenta0c7c0a5b2e431ed29943e9b5ad8f476e9e4852a (diff)
downloadhomebrew-d688fa310a73c6fb5400293bfaffc989795d4f36.tar.bz2
Add initial brew bottle implementation.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/examples/brew-bottle.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/Library/Contributions/examples/brew-bottle.rb b/Library/Contributions/examples/brew-bottle.rb
new file mode 100755
index 000000000..5293e811f
--- /dev/null
+++ b/Library/Contributions/examples/brew-bottle.rb
@@ -0,0 +1,21 @@
+# Builds binary brew package
+brew_install
+
+destination = HOMEBREW_PREFIX + "Bottles"
+if not File.directory?(destination)
+ Dir.mkdir destination
+end
+
+ARGV.each do|formula|
+ # Get the latest version
+ version = `brew list --versions #{formula}`.split.last
+ source = HOMEBREW_CELLAR + formula + version
+ filename = formula + '-' + version + '.tar.gz'
+ ohai "Bottling #{formula} #{version}..."
+ HOMEBREW_CELLAR.cd do
+ # Use gzip, much faster than bzip2 and hardly any file size difference
+ # when compressing binaries.
+ safe_system "tar czf #{destination}/#{filename} #{formula}/#{version}"
+ end
+ ohai "Bottled #{filename}"
+end \ No newline at end of file