From 7d88c110f65973a8ba72955653acd5a05261ad94 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 14 May 2015 09:40:53 +0100 Subject: [PATCH] test-bot: rerun brew update if it fails. --- Library/Homebrew/cmd/test-bot.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb index 20a052c78b..5c62417d01 100644 --- a/Library/Homebrew/cmd/test-bot.rb +++ b/Library/Homebrew/cmd/test-bot.rb @@ -256,6 +256,12 @@ module Homebrew end end + def brew_update + return unless current_branch == "master" + success = quiet_system "brew", "update" + success ||= quiet_system "brew", "update" + end + @category = __method__ @start_branch = current_branch @@ -264,13 +270,13 @@ module Homebrew and not ENV['ghprbPullLink'] diff_start_sha1 = shorten_revision ENV['GIT_PREVIOUS_COMMIT'] diff_end_sha1 = shorten_revision ENV['GIT_COMMIT'] - test "brew", "update" if current_branch == "master" + brew_update elsif @hash diff_start_sha1 = current_sha1 - test "brew", "update" if current_branch == "master" + brew_update diff_end_sha1 = current_sha1 elsif @url - test "brew", "update" if current_branch == "master" + brew_update end # Handle Jenkins pull request builder plugin.