From 8ad07144f72601d6bf42b71e4b706c3e0f5961dc Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 29 Jul 2014 11:08:18 +0200 Subject: [PATCH] brew-test-bot: handle changed formulae deps. If both a formula and its dependencies are changed in a single pull request it'll fail because the bottle block may no longer be correct. Handle this case by ignoring bottle pour failures and fetching the source packages instead of bottles. --- Library/Contributions/cmd/brew-test-bot.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Contributions/cmd/brew-test-bot.rb b/Library/Contributions/cmd/brew-test-bot.rb index b7d254aef3..210c5b3a8e 100755 --- a/Library/Contributions/cmd/brew-test-bot.rb +++ b/Library/Contributions/cmd/brew-test-bot.rb @@ -297,6 +297,8 @@ class Test test "brew", "uses", formula dependencies = `brew deps #{formula}`.split("\n") dependencies -= `brew list`.split("\n") + unchanged_dependencies = dependencies - @formulae + changed_dependences = dependencies - unchanged_dependencies formula_object = Formulary.factory(formula) return unless satisfied_requirements?(formula_object, :stable) @@ -315,7 +317,8 @@ class Test return end - test "brew", "fetch", "--retry", *dependencies unless dependencies.empty? + test "brew", "fetch", "--retry", *unchanged_dependencies unless unchanged_dependencies.empty? + test "brew", "fetch", "--retry", "--build-from-source", *changed_dependences unless changed_dependences.empty? formula_fetch_options = [] formula_fetch_options << "--build-bottle" unless ARGV.include? "--no-bottle" formula_fetch_options << "--force" if ARGV.include? "--cleanup" @@ -326,7 +329,10 @@ class Test install_args << "--build-bottle" unless ARGV.include? "--no-bottle" install_args << "--HEAD" if ARGV.include? "--HEAD" install_args << formula + # Don't care about e.g. bottle failures for dependencies. + ENV["HOMEBREW_DEVELOPER"] = nil test "brew", "install", "--only-dependencies", *install_args unless dependencies.empty? + ENV["HOMEBREW_DEVELOPER"] = "1" test "brew", "install", *install_args install_passed = steps.last.passed? test "brew", "audit", formula