From 5ac0446fd704dd9af4b507bdbb9cd373b1929f7c Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 19 Jan 2015 13:39:38 +0000 Subject: [PATCH] test-bot: support --devel and/or --HEAD install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Library/Homebrew/cmd/test-bot.rb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb index 1d7458a6d4..857ae5631c 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