From cf751fd0133113d59c2ed57b7797c7e9bd2fdd67 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 10 Sep 2013 22:10:58 +0100 Subject: [PATCH] brew-test-bot: allow skipping bottle creation. --- Library/Contributions/cmd/brew-test-bot.rb | 31 +++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/Library/Contributions/cmd/brew-test-bot.rb b/Library/Contributions/cmd/brew-test-bot.rb index 192eff09ea..e728c9fba7 100755 --- a/Library/Contributions/cmd/brew-test-bot.rb +++ b/Library/Contributions/cmd/brew-test-bot.rb @@ -8,6 +8,7 @@ # --skip-setup: Don't check the local system is setup correctly. # --junit: Generate a JUnit XML test results file. # --email: Generate an email subject file. +# --no-bottle: Run brew install without --build-bottle # --HEAD: Run brew install with --HEAD # --devel: Run brew install with --devel @@ -257,29 +258,33 @@ class Test end test "brew fetch #{dependencies}" unless dependencies.empty? - formula_fetch_options = "--build-bottle" + formula_fetch_options = "" + formula_fetch_options << " --build-bottle" unless ARGV.include? '--no-bottle' formula_fetch_options << " --force" if ARGV.include? '--cleanup' test "brew fetch #{formula_fetch_options} #{formula}" test "brew uninstall --force #{formula}" if formula_object.installed? - install_args = '--verbose --build-bottle' + install_args = '--verbose' + install_args << ' --build-bottle' unless ARGV.include? '--no-bottle' install_args << ' --HEAD' if ARGV.include? '--HEAD' install_args << ' --devel' if ARGV.include? '--devel' test "brew install #{install_args} #{formula}" install_passed = steps.last.passed? test "brew audit #{formula}" return unless install_passed - test "brew bottle #{formula}", :puts_output_on_success => true - bottle_step = steps.last - if bottle_step.passed? and bottle_step.has_output? - bottle_revision = bottle_new_revision(formula_object) - bottle_filename = bottle_filename(formula_object, bottle_revision) - bottle_base = bottle_filename.gsub(bottle_suffix(bottle_revision), '') - bottle_output = bottle_step.output.gsub /.*(bottle do.*end)/m, '\1' - File.open "#{bottle_base}.bottle.rb", 'w' do |file| - file.write bottle_output + unless ARGV.include? '--no-bottle' + test "brew bottle #{formula}", :puts_output_on_success => true + bottle_step = steps.last + if bottle_step.passed? and bottle_step.has_output? + bottle_revision = bottle_new_revision(formula_object) + bottle_filename = bottle_filename(formula_object, bottle_revision) + bottle_base = bottle_filename.gsub(bottle_suffix(bottle_revision), '') + bottle_output = bottle_step.output.gsub /.*(bottle do.*end)/m, '\1' + File.open "#{bottle_base}.bottle.rb", 'w' do |file| + file.write bottle_output + end + test "brew uninstall --force #{formula}" + test "brew install #{bottle_filename}" end - test "brew uninstall --force #{formula}" - test "brew install #{bottle_filename}" end test "brew test #{formula}" if formula_object.test_defined? test "brew uninstall --force #{formula}"