Move bottle.rb logic from test-bot to brew bottle.
This commit is contained in:
parent
b2a983343b
commit
5d0f868f06
@ -53,7 +53,7 @@ class Step
|
|||||||
end
|
end
|
||||||
|
|
||||||
def command_short
|
def command_short
|
||||||
@command.gsub(/(brew|--force|--verbose|--build-bottle) /, '').strip.squeeze ' '
|
@command.gsub(/(brew|--force|--verbose|--build-bottle|--rb) /, '').strip.squeeze ' '
|
||||||
end
|
end
|
||||||
|
|
||||||
def passed?
|
def passed?
|
||||||
@ -276,16 +276,11 @@ class Test
|
|||||||
test "brew audit #{formula}"
|
test "brew audit #{formula}"
|
||||||
return unless install_passed
|
return unless install_passed
|
||||||
unless ARGV.include? '--no-bottle'
|
unless ARGV.include? '--no-bottle'
|
||||||
test "brew bottle #{formula}", :puts_output_on_success => true
|
test "brew bottle --rb #{formula}", :puts_output_on_success => true
|
||||||
bottle_step = steps.last
|
bottle_step = steps.last
|
||||||
if bottle_step.passed? and bottle_step.has_output?
|
if bottle_step.passed? and bottle_step.has_output?
|
||||||
bottle_revision = bottle_new_revision(formula_object)
|
bottle_filename =
|
||||||
bottle_filename = bottle_filename(formula_object, bottle_revision)
|
bottle_step.output.gsub(/.*(\.\/\S+#{bottle_native_regex}).*/m, '\1')
|
||||||
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 uninstall --force #{formula}"
|
||||||
test "brew install #{bottle_filename}"
|
test "brew install #{bottle_filename}"
|
||||||
end
|
end
|
||||||
|
|||||||
@ -50,11 +50,6 @@ def bottle_file_outdated? f, file
|
|||||||
bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext
|
bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext
|
||||||
end
|
end
|
||||||
|
|
||||||
def bottle_new_revision f
|
|
||||||
return 0 unless bottle_current? f
|
|
||||||
f.bottle.revision + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
def bottle_native_suffix revision=nil
|
def bottle_native_suffix revision=nil
|
||||||
".#{bottle_tag}#{bottle_suffix(revision)}"
|
".#{bottle_tag}#{bottle_suffix(revision)}"
|
||||||
end
|
end
|
||||||
|
|||||||
@ -114,6 +114,13 @@ module Homebrew extend self
|
|||||||
output = bottle_output bottle
|
output = bottle_output bottle
|
||||||
puts output
|
puts output
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if ARGV.include? '--rb'
|
||||||
|
bottle_base = filename.gsub(bottle_suffix(bottle_revision), '')
|
||||||
|
File.open "#{bottle_base}.bottle.rb", 'w' do |file|
|
||||||
|
file.write output
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def merge
|
def merge
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user