diff options
| author | Max Howell | 2009-06-08 11:44:04 +0100 |
|---|---|---|
| committer | Max Howell | 2009-06-08 11:44:04 +0100 |
| commit | 21a935bb026f43928bc1ffc89b5f3f0cc8d3a820 (patch) | |
| tree | 291c3a03850fb697e13ac2e0e90ce6c04acccfb1 /Library/Homebrew | |
| parent | 71a628740987ed5737440ec2f2f350e73c51452b (diff) | |
| download | brew-21a935bb026f43928bc1ffc89b5f3f0cc8d3a820.tar.bz2 | |
clean deep into lib and bin dirs
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/brewkit.rb | 33 |
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 |
