brew-test-bot: only install bottle if created OK.

This commit is contained in:
Mike McQuaid 2013-07-17 22:08:57 -07:00
parent 1a4bea3a55
commit e33d3e1e5c

View File

@ -268,18 +268,18 @@ class Test
test "brew audit #{formula}"
return unless install_passed
test "brew bottle #{formula}", :puts_output_on_success => true
bottle_revision = bottle_new_revision(formula_object)
bottle_filename = bottle_filename(formula_object, bottle_revision)
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}"
test "brew test #{formula}" if formula_object.test_defined?
test "brew uninstall --force #{formula}"
test "brew uninstall --force #{dependencies}" unless dependencies.empty?