aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorPaul O'Neil2010-06-17 09:41:33 -0400
committerAdam Vandenberg2010-06-18 21:11:43 -0700
commit40b1ba1c29bb9b684295a691b92540fafa6b7129 (patch)
treed4d38d8a3408d68a46426b20acfd70e22001fba2 /Library
parent3a97b2cf678557d4f07691d8d4c89727e7962ff1 (diff)
downloadbrew-40b1ba1c29bb9b684295a691b92540fafa6b7129.tar.bz2
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 Homebrew/homebrew#1633
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb4
1 files changed, 1 insertions, 3 deletions
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