From 12d17155cf9c3c66bf707caa6e4f55ef82a2ca97 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Tue, 18 Sep 2012 16:25:44 -0400 Subject: [PATCH] If we delete stuff in the clean step, make fuss /cc @jwheare --- Library/Homebrew/cleaner.rb | 14 ++++++++++++++ Library/Homebrew/formula_installer.rb | 1 + 2 files changed, 15 insertions(+) diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb index d40cdaf97c..9907745d5c 100644 --- a/Library/Homebrew/cleaner.rb +++ b/Library/Homebrew/cleaner.rb @@ -52,6 +52,8 @@ class Cleaner # Clean a single folder (non-recursively) def clean_dir d d.find do |path| + path.extend(NoiseyPathname) if ARGV.verbose? + if path.directory? # Stop cleaning this subtree if protected Find.prune if @f.skip_clean? path @@ -72,3 +74,15 @@ class Cleaner end end + + +class Pathname + alias_method :orig_unlink, :unlink +end + +module NoiseyPathname + def unlink + puts "rm: #{self}" + orig_unlink + end +end diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index d4ae876bdc..d9cff505c1 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -303,6 +303,7 @@ class FormulaInstaller end def clean + ohai "Cleaning" if ARGV.verbose? if f.class.skip_clean_all? opoo "skip_clean :all is deprecated" puts "Skip clean was commonly used to prevent brew from stripping binaries."