aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMax Howell2009-06-08 11:44:04 +0100
committerMax Howell2009-06-08 11:44:04 +0100
commit21a935bb026f43928bc1ffc89b5f3f0cc8d3a820 (patch)
tree291c3a03850fb697e13ac2e0e90ce6c04acccfb1 /Library/Homebrew
parent71a628740987ed5737440ec2f2f350e73c51452b (diff)
downloadbrew-21a935bb026f43928bc1ffc89b5f3f0cc8d3a820.tar.bz2
clean deep into lib and bin dirs
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/brewkit.rb33
1 files changed, 15 insertions, 18 deletions
diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb
index a0c4d9a12..45efd2628 100644
--- a/Library/Homebrew/brewkit.rb
+++ b/Library/Homebrew/brewkit.rb
@@ -210,28 +210,25 @@ public
end
end
end
-
+
def clean
- prefix.find do |path|
- if path==prefix #rubysucks
+ [bin,lib].each {|path| path.find do |path|
+ if not path.file?
next
- elsif path.file?
- if path.extname == '.la'
- path.unlink
- else
- fo=`file -h #{path}`
- args=nil
- args='-SxX' if fo =~ /Mach-O dynamically linked shared library/
- args='' if fo =~ /Mach-O executable/ #defaults strip everything
- if args
- puts "Stripping: #{path}" if ARGV.include? '--verbose'
- `strip #{args} #{path}`
- end
+ elsif path.extname == '.la'
+ # .la files are stupid
+ path.unlink
+ else
+ fo=`file -h #{path}`
+ args=nil
+ args='-SxX' if fo =~ /Mach-O dynamically linked shared library/
+ args='' if fo =~ /Mach-O executable/ #defaults strip everything
+ if args
+ puts "Stripping: #{path}" if ARGV.include? '--verbose'
+ `strip #{args} #{path}`
end
- elsif path.directory? and path!=prefix+'bin' and path!=prefix+'lib'
- Find.prune
end
- end
+ end}
end
protected