From 18f9969b65d3a9a39ae721c1d967d596b7aef898 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 22 Sep 2010 08:12:03 -0700 Subject: [PATCH] Add formula name to LLVM warning --- Library/Homebrew/formula.rb | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 8eac1fc276..f8298624ce 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -217,6 +217,27 @@ class Formula "-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None -Wno-dev" end + def fails_with_llvm msg="", data=nil + return unless (ENV['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm') + + build = data.delete :build rescue nil + msg = "(No specific reason was given)" if msg.empty? + + opoo "LLVM was requested, but this formula is reported as not working with LLVM:" + puts msg + puts "Tested with LLVM build #{build}" unless build == nil + puts + + if ARGV.force? + puts "Continuing anyway. If this works, let us know so we can update the\n"+ + "formula to remove the warning." + else + puts "Continuing with GCC 4.2 instead.\n"+ + "(Use `brew install --force #{name}` to force use of LLVM.)" + ENV.gcc_4_2 + end + end + def self.class_s name #remove invalid characters and then camelcase it name.capitalize.gsub(/[-_.\s]([a-zA-Z0-9])/) { $1.upcase } \ @@ -281,27 +302,6 @@ class Formula self.class.external_deps end - def fails_with_llvm msg="", data=nil - return unless (ENV['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm') - - build = data.delete :build rescue nil - msg = "(No specific reason was given)" if msg.empty? - - opoo "LLVM was requested, but this formula is reported as not working with LLVM:" - puts msg - puts "Tested with LLVM build #{build}" unless build == nil - puts - - if ARGV.force? - puts "Continuing anyway. If this works, let us know so we can update the\n"+ - "formula to remove the warning." - else - puts "Continuing with GCC 4.2 instead.\n"+ - "(Use `brew install --force ...` to force use of LLVM.)" - ENV.gcc_4_2 - end - end - protected # Pretty titles the command and buffers stdout/stderr # Throws if there's an error