aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2009-05-23 13:07:19 +0100
committerMax Howell2009-05-23 18:19:10 +0100
commit9c864343b6525d201afa1155f419a3439044495d (patch)
treefcb448bd3b1e43abc780a85c5233bc1bc1a910e1
parent4e81f810dbb3fadd15436bbfe78c1551088b2bec (diff)
downloadbrew-9c864343b6525d201afa1155f419a3439044495d.tar.bz2
Strip executables and dylibs
-rw-r--r--Cellar/homebrew/brewkit.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/Cellar/homebrew/brewkit.rb b/Cellar/homebrew/brewkit.rb
index 66b142ceb..cbab2952a 100644
--- a/Cellar/homebrew/brewkit.rb
+++ b/Cellar/homebrew/brewkit.rb
@@ -63,7 +63,7 @@ class Formula
prefix=$cellar+@name+@version
raise "#{prefix} already exists!" if prefix.exist?
- ohai "Preparing build"
+ ohai "Downloading #{@url}"
appsupport = File.expand_path "~/Library/Application Support/Homebrew"
FileUtils.mkpath appsupport unless File.exist? appsupport
@@ -104,8 +104,21 @@ class Formula
FileUtils.rm_rf tmp
end
+ ohai 'Finishing up'
+
# stay in appsupport in case any odd files gets created etc.
`#{$cellar}/homebrew/brew ln #{prefix}` if prefix.exist?
+
+ prefix.find do |path|
+ if path==prefix #rubysucks
+ next
+ elsif path.file? and `file -h #{path}` =~ /Mach-O/
+ puts "strip #{path}" if ARGV.include? '--verbose'
+ `strip #{path}`
+ elsif path.directory? and path!=prefix+'bin' and path!=prefix+'lib'
+ Find.prune
+ end
+ end
puts "#{prefix}: "+`find #{prefix} -type f | wc -l`.strip+' files, '+`du -hd0 #{prefix} | cut -d"\t" -f1`.strip+", built in #{Time.now - beginning} seconds"
end
@@ -134,6 +147,8 @@ protected
unless File.exists? tgz
`curl -#LA "#{$agent}" #{oarg} "#{@url}"`
raise "Download failed" unless $? == 0
+ else
+ puts "File already downloaded and cached"
end
return tgz
end
@@ -175,7 +190,7 @@ class GithubGistFormula < Formula
def initialize(url, md5)
@url=url
@name=File.basename url
- @version=File.basename(File.dirname url)[0,6]
+ @version=File.basename(File.dirname(url))[0,6]
@md5=md5
brew do |prefix|