test-bot: fetch/audit formulae despite requirement

It's still useful to do a basic test even if requirements cannot be
satisfied.
This commit is contained in:
Mike McQuaid 2015-12-10 10:41:43 +00:00
parent d2a44869f0
commit 4b3056e2fc

View File

@ -436,13 +436,28 @@ module Homebrew
deps = [] deps = []
reqs = [] 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 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?) deps |= formula.stable.deps.to_a.reject(&:optional?)
reqs |= formula.stable.requirements.to_a.reject(&:optional?) reqs |= formula.stable.requirements.to_a.reject(&:optional?)
elsif formula.devel 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 end
if formula.devel && !ARGV.include?("--HEAD") if formula.devel && !ARGV.include?("--HEAD")
@ -531,11 +546,7 @@ module Homebrew
# this step # this step
test "brew", "postinstall", *changed_dependences test "brew", "postinstall", *changed_dependences
end end
formula_fetch_options = [] test "brew", "fetch", "--retry", *fetch_args
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", "uninstall", "--force", canonical_formula_name if formula.installed? test "brew", "uninstall", "--force", canonical_formula_name if formula.installed?
install_args = ["--verbose"] install_args = ["--verbose"]
install_args << "--build-bottle" if !ARGV.include?("--fast") && !formula.bottle_disabled? install_args << "--build-bottle" if !ARGV.include?("--fast") && !formula.bottle_disabled?
@ -563,8 +574,6 @@ module Homebrew
install_passed = steps.last.passed? install_passed = steps.last.passed?
end end
end end
audit_args = [canonical_formula_name]
audit_args << "--strict" << "--online" if @added_formulae.include? formula_name
test "brew", "audit", *audit_args test "brew", "audit", *audit_args
if install_passed if install_passed
if formula.stable? && !ARGV.include?("--fast") && !formula.bottle_disabled? if formula.stable? && !ARGV.include?("--fast") && !formula.bottle_disabled?
@ -610,7 +619,7 @@ module Homebrew
if formula.devel && formula.stable? \ if formula.devel && formula.stable? \
&& !ARGV.include?("--HEAD") && !ARGV.include?("--fast") \ && !ARGV.include?("--HEAD") && !ARGV.include?("--fast") \
&& satisfied_requirements?(formula, :devel) && 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 } run_as_not_developer { test "brew", "install", "--devel", "--verbose", canonical_formula_name }
devel_install_passed = steps.last.passed? devel_install_passed = steps.last.passed?
test "brew", "audit", "--devel", *audit_args test "brew", "audit", "--devel", *audit_args