From 5883f1675d71c09a722343ef3f71280c246bc1bb Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 15 Apr 2014 08:29:30 +0100 Subject: [PATCH] brew-test-bot: check CompilerSelectionError twice. It may be that even installing a new compiler doesn't fix things so detect that case and skip the formula installation rather than erroring out. --- Library/Contributions/cmd/brew-test-bot.rb | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Library/Contributions/cmd/brew-test-bot.rb b/Library/Contributions/cmd/brew-test-bot.rb index 01af3f026c..a39b096b1d 100755 --- a/Library/Contributions/cmd/brew-test-bot.rb +++ b/Library/Contributions/cmd/brew-test-bot.rb @@ -245,6 +245,10 @@ class Test end end + def skip formula + puts "#{Tty.blue}==>#{Tty.white} SKIPPING: #{formula}#{Tty.reset}" + end + def setup @category = __method__ return if ARGV.include? "--skip-setup" @@ -264,15 +268,23 @@ class Test requirements = formula_object.recursive_requirements unsatisfied_requirements = requirements.reject {|r| r.satisfied? or r.default_formula?} unless unsatisfied_requirements.empty? - puts "#{Tty.blue}==>#{Tty.white} SKIPPING: #{formula}#{Tty.reset}" + skip formula unsatisfied_requirements.each {|r| puts r.message} return end + installed_gcc = false begin CompilerSelector.new(formula_object).compiler - rescue CompilerSelectionError - test "brew install apple-gcc42" + rescue CompilerSelectionError => e + unless installed_gcc + test "brew install apple-gcc42" + installed_gcc = true + retry + end + skip formula + puts e.message + return end test "brew fetch --retry #{dependencies}" unless dependencies.empty?