From 5790f4b523c47b8643408e83b7f92a4d68041eae Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 29 Aug 2012 15:43:28 -0400 Subject: [PATCH] Display skip-clean warning only before clean Not anytime the formula loads. --- Library/Homebrew/formula.rb | 6 +----- Library/Homebrew/formula_installer.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 2c33452560..08e01a7d78 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -678,11 +678,7 @@ private def skip_clean paths if paths == :all - opoo "skip_clean :all is deprecated" - puts "Skip clean was commonly used to prevent brew from stripping binaries." - puts "brew no longer strips binaries, if skip_clean is required to prevent" - puts "brew from removing empty directories, you should specify exact paths" - puts "in the formula." + @skip_clean_all = true return end @skip_clean_paths ||= [] diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 6e1f596338..808f5c1621 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -294,6 +294,14 @@ class FormulaInstaller end def clean + if f.class.skip_clean_all? + opoo "skip_clean :all is deprecated" + puts "Skip clean was commonly used to prevent brew from stripping binaries." + puts "brew no longer strips binaries, if skip_clean is required to prevent" + puts "brew from removing empty directories, you should specify exact paths" + puts "in the formula." + return + end require 'cleaner' Cleaner.new f rescue Exception => e