aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/test-bot.rb
diff options
context:
space:
mode:
authorDominyk Tiller2015-01-19 13:39:38 +0000
committerMike McQuaid2015-01-27 12:40:36 +0000
commit5ac0446fd704dd9af4b507bdbb9cd373b1929f7c (patch)
treea741833fecf82dc61343e1b9c9df63413e198f39 /Library/Homebrew/cmd/test-bot.rb
parenta2cb0c2af525a59da836b1f9b6645ee72e0dd657 (diff)
downloadbrew-5ac0446fd704dd9af4b507bdbb9cd373b1929f7c.tar.bz2
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>
Diffstat (limited to 'Library/Homebrew/cmd/test-bot.rb')
-rw-r--r--Library/Homebrew/cmd/test-bot.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb
index 1d7458a6d..857ae5631 100644
--- a/Library/Homebrew/cmd/test-bot.rb
+++ b/Library/Homebrew/cmd/test-bot.rb
@@ -27,6 +27,7 @@ require 'date'
require 'rexml/document'
require 'rexml/xmldecl'
require 'rexml/cdata'
+require 'cmd/tap'
module Homebrew
EMAIL_SUBJECT_FILE = "brew-test-bot.#{MacOS.cat}.email.txt"
@@ -425,6 +426,15 @@ module Homebrew
install_args = %w[--verbose]
install_args << "--build-bottle" unless ARGV.include? "--no-bottle"
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
# Don't care about e.g. bottle failures for dependencies.
ENV["HOMEBREW_DEVELOPER"] = nil
@@ -471,7 +481,7 @@ module Homebrew
test "brew", "uninstall", "--force", formula_name
end
- if formula.devel && !ARGV.include?('--HEAD') \
+ if formula.devel && formula.stable? && !ARGV.include?('--HEAD') \
&& satisfied_requirements?(formula, :devel)
test "brew", "fetch", "--retry", "--devel", *formula_fetch_options
test "brew", "install", "--devel", "--verbose", formula_name
@@ -572,6 +582,14 @@ module Homebrew
changed_formulae + unchanged_formulae
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
cleanup_before
download