diff options
| author | Max Howell | 2009-06-08 11:44:04 +0100 |
|---|---|---|
| committer | Max Howell | 2009-06-08 11:44:04 +0100 |
| commit | 1cf52c334c93b1741745f01ae48e6dc44562316c (patch) | |
| tree | 1c5b1df228c8ac25fd9670aa50fcd8854275e2fe /Library | |
| parent | 595938b69aa02e603367fa43114ebdaf95714c5b (diff) | |
| download | homebrew-1cf52c334c93b1741745f01ae48e6dc44562316c.tar.bz2 | |
clean deep into lib and bin dirs
Diffstat (limited to 'Library')
| -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 |
