From 344cb2f710f8d5ade603180ccd9d71882fefa481 Mon Sep 17 00:00:00 2001 From: Paul O'Neil Date: Thu, 17 Jun 2010 09:41:33 -0400 Subject: cleans only existing directories The previous code works fine on ruby 1.8.x, but under 1.9 trying find on a non-existent folder gives: ==> No such file or directory /usr/local/Cellar/ruby/1.9.1-p378/lib/ruby/1.9.1/find.rb:38:in `block in find' Fixes #1633 --- Library/Homebrew/brew.h.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb index 9e25bfb93..4c733b7c5 100644 --- a/Library/Homebrew/brew.h.rb +++ b/Library/Homebrew/brew.h.rb @@ -478,9 +478,7 @@ end class Cleaner def initialize f @f=f - - [f.bin, f.sbin, f.lib].each {|d| clean_dir d} - + [f.bin, f.sbin, f.lib].select{|d|d.exist?}.each{|d|clean_dir d} # info pages suck info = f.share+'info' info.rmtree if info.directory? and not f.skip_clean? info -- cgit v1.2.3