From 1f86923ec22388f5ced7e0ef0e767738be16b9ae Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sun, 23 Feb 2014 12:09:28 -0800 Subject: [PATCH] ignore skip_clean :all --- Library/Homebrew/cmd/audit.rb | 3 ++- Library/Homebrew/formula.rb | 19 ++++--------------- Library/Homebrew/formula_installer.rb | 8 -------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 4c44de2c19..71445ca4d9 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -447,7 +447,8 @@ class FormulaAuditor end if line =~ /skip_clean\s+:all/ - problem "`skip_clean :all` is deprecated; brew no longer strips symbols" + problem "`skip_clean :all` is deprecated; brew no longer strips symbols\n" + + "\tPass explicit paths to prevent Homebrew from removing empty folders." end if line =~ /depends_on [A-Z][\w:]+\.new$/ diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index e48d21a2ce..f1a2f0de1b 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -247,12 +247,11 @@ class Formula end end - # sometimes the clean process breaks things + # sometimes the cleaner breaks things # skip cleaning paths in a formula with a class method like this: - # skip_clean [bin+"foo", lib+"bar"] - # redefining skip_clean? now deprecated + # skip_clean bin/"foo", lib/"bar" + # skip_clean :la def skip_clean? path - return true if self.class.skip_clean_all? return true if path.extname == '.la' and self.class.skip_clean_paths.include? :la to_check = path.relative_path_from(prefix).to_s self.class.skip_clean_paths.include? to_check @@ -745,20 +744,10 @@ class Formula def skip_clean *paths paths.flatten! - - # :all is deprecated though - if paths.include? :all - @skip_clean_all = true - return - end - + # Specifying :all is deprecated and will become an error skip_clean_paths.merge(paths) end - def skip_clean_all? - @skip_clean_all - end - def skip_clean_paths @skip_clean_paths ||= Set.new end diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 0a6031d426..c74687a988 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -482,14 +482,6 @@ class FormulaInstaller 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." - 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 Cleaner.new(f).clean rescue Exception => e opoo "The cleaning step did not complete successfully"