From 4b3056e2fc6c2c0bcc7fca630c0e03adc20712ee Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 10 Dec 2015 10:41:43 +0000 Subject: [PATCH] test-bot: fetch/audit formulae despite requirement It's still useful to do a basic test even if requirements cannot be satisfied. --- Library/Homebrew/cmd/test-bot.rb | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb index 222df08ff1..ab2a86c3b0 100644 --- a/Library/Homebrew/cmd/test-bot.rb +++ b/Library/Homebrew/cmd/test-bot.rb @@ -436,13 +436,28 @@ module Homebrew deps = [] reqs = [] + fetch_args = [canonical_formula_name] + fetch_args << "--build-bottle" if !ARGV.include?("--fast") && !formula.bottle_disabled? + fetch_args << "--force" if ARGV.include? "--cleanup" + + audit_args = [canonical_formula_name] + audit_args << "--strict" << "--online" if @added_formulae.include? formula_name + if formula.stable - return unless satisfied_requirements?(formula, :stable) + unless satisfied_requirements?(formula, :stable) + test "brew", "fetch", "--retry", *fetch_args + test "brew", "audit", *audit_args + return + end deps |= formula.stable.deps.to_a.reject(&:optional?) reqs |= formula.stable.requirements.to_a.reject(&:optional?) elsif formula.devel - return unless satisfied_requirements?(formula, :devel) + unless satisfied_requirements?(formula, :devel) + test "brew", "fetch", "--retry", "--devel", *fetch_args + test "brew", "audit", "--devel", *audit_args + return + end end if formula.devel && !ARGV.include?("--HEAD") @@ -531,11 +546,7 @@ module Homebrew # this step test "brew", "postinstall", *changed_dependences end - formula_fetch_options = [] - formula_fetch_options << "--build-bottle" if !ARGV.include?("--fast") && !formula.bottle_disabled? - formula_fetch_options << "--force" if ARGV.include? "--cleanup" - formula_fetch_options << canonical_formula_name - test "brew", "fetch", "--retry", *formula_fetch_options + test "brew", "fetch", "--retry", *fetch_args test "brew", "uninstall", "--force", canonical_formula_name if formula.installed? install_args = ["--verbose"] install_args << "--build-bottle" if !ARGV.include?("--fast") && !formula.bottle_disabled? @@ -563,8 +574,6 @@ module Homebrew install_passed = steps.last.passed? end end - audit_args = [canonical_formula_name] - audit_args << "--strict" << "--online" if @added_formulae.include? formula_name test "brew", "audit", *audit_args if install_passed if formula.stable? && !ARGV.include?("--fast") && !formula.bottle_disabled? @@ -610,7 +619,7 @@ module Homebrew if formula.devel && formula.stable? \ && !ARGV.include?("--HEAD") && !ARGV.include?("--fast") \ && satisfied_requirements?(formula, :devel) - test "brew", "fetch", "--retry", "--devel", *formula_fetch_options + test "brew", "fetch", "--retry", "--devel", *fetch_args run_as_not_developer { test "brew", "install", "--devel", "--verbose", canonical_formula_name } devel_install_passed = steps.last.passed? test "brew", "audit", "--devel", *audit_args