diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb index 3e23988abc..400602ad41 100644 --- a/Library/Homebrew/brew.h.rb +++ b/Library/Homebrew/brew.h.rb @@ -383,11 +383,11 @@ class Cleaner # you can read all of this stuff online nowadays, save the space # info pages are pants, everyone agrees apart from Richard Stallman # feel free to ask for build options though! http://bit.ly/Homebrew - (f.prefix+'share'+'doc').rmtree rescue nil - (f.prefix+'share'+'info').rmtree rescue nil - (f.prefix+'doc').rmtree rescue nil - (f.prefix+'docs').rmtree rescue nil - (f.prefix+'info').rmtree rescue nil + unlink = Proc.new{ |path| path.unlink unless f.skip_clean? path rescue nil } + %w[doc docs info].each do |fn| + unlink.call(f.share+fn) + unlink.call(f.prefix+fn) + end end private