test-bot: support --devel and/or --HEAD install
See discussion in https://github.com/Homebrew/homebrew-devel-only/pull/8 In essence, the test bot currently does this: ``` ==> brew install --verbose --build-bottle j2objc FAILED Error: j2objc is a devel-only formula Install with `brew install --devel j2objc` ``` I’m proposing that we pass that arg to the test-bot automatically to allow the bot to pass head-only and devel-only formulae without that failure message. I’ve also trimmed the arguments further down to prevent it duplicating the —devel install in formulae which define no stable block. Closes Homebrew/homebrew#36030. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
a2cb0c2af5
commit
5ac0446fd7
@ -27,6 +27,7 @@ require 'date'
|
|||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
require 'rexml/xmldecl'
|
require 'rexml/xmldecl'
|
||||||
require 'rexml/cdata'
|
require 'rexml/cdata'
|
||||||
|
require 'cmd/tap'
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
EMAIL_SUBJECT_FILE = "brew-test-bot.#{MacOS.cat}.email.txt"
|
EMAIL_SUBJECT_FILE = "brew-test-bot.#{MacOS.cat}.email.txt"
|
||||||
@ -425,6 +426,15 @@ module Homebrew
|
|||||||
install_args = %w[--verbose]
|
install_args = %w[--verbose]
|
||||||
install_args << "--build-bottle" unless ARGV.include? "--no-bottle"
|
install_args << "--build-bottle" unless ARGV.include? "--no-bottle"
|
||||||
install_args << "--HEAD" if ARGV.include? "--HEAD"
|
install_args << "--HEAD" if ARGV.include? "--HEAD"
|
||||||
|
|
||||||
|
# Pass --devel or --HEAD to install in the event formulae lack stable. Supports devel-only/head-only.
|
||||||
|
# head-only should not have devel, but devel-only can have head. Stable can have all three.
|
||||||
|
if devel_only_tap? formula
|
||||||
|
install_args << "--devel"
|
||||||
|
elsif head_only_tap? formula
|
||||||
|
install_args << "--HEAD"
|
||||||
|
end
|
||||||
|
|
||||||
install_args << formula_name
|
install_args << formula_name
|
||||||
# Don't care about e.g. bottle failures for dependencies.
|
# Don't care about e.g. bottle failures for dependencies.
|
||||||
ENV["HOMEBREW_DEVELOPER"] = nil
|
ENV["HOMEBREW_DEVELOPER"] = nil
|
||||||
@ -471,7 +481,7 @@ module Homebrew
|
|||||||
test "brew", "uninstall", "--force", formula_name
|
test "brew", "uninstall", "--force", formula_name
|
||||||
end
|
end
|
||||||
|
|
||||||
if formula.devel && !ARGV.include?('--HEAD') \
|
if formula.devel && formula.stable? && !ARGV.include?('--HEAD') \
|
||||||
&& satisfied_requirements?(formula, :devel)
|
&& satisfied_requirements?(formula, :devel)
|
||||||
test "brew", "fetch", "--retry", "--devel", *formula_fetch_options
|
test "brew", "fetch", "--retry", "--devel", *formula_fetch_options
|
||||||
test "brew", "install", "--devel", "--verbose", formula_name
|
test "brew", "install", "--devel", "--verbose", formula_name
|
||||||
@ -572,6 +582,14 @@ module Homebrew
|
|||||||
changed_formulae + unchanged_formulae
|
changed_formulae + unchanged_formulae
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def head_only_tap? formula
|
||||||
|
formula.head && formula.devel.nil? && formula.stable.nil? && formula.tap == "homebrew/homebrew-head-only"
|
||||||
|
end
|
||||||
|
|
||||||
|
def devel_only_tap? formula
|
||||||
|
formula.devel && formula.stable.nil? && formula.tap == "homebrew/homebrew-devel-only"
|
||||||
|
end
|
||||||
|
|
||||||
def run
|
def run
|
||||||
cleanup_before
|
cleanup_before
|
||||||
download
|
download
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user