test-bot: use canonical names for taps.
This commit is contained in:
parent
0161d50d7a
commit
f27f427d95
@ -358,19 +358,25 @@ module Homebrew
|
|||||||
def formula formula_name
|
def formula formula_name
|
||||||
@category = "#{__method__}.#{formula_name}"
|
@category = "#{__method__}.#{formula_name}"
|
||||||
|
|
||||||
test "brew", "uses", formula_name
|
canonical_formula_name = if @tap
|
||||||
dependencies = `brew deps #{formula_name}`.split("\n")
|
"#{@tap}/#{formula_name}"
|
||||||
|
else
|
||||||
|
formula_name
|
||||||
|
end
|
||||||
|
|
||||||
|
test "brew", "uses", canonical_formula_name
|
||||||
|
dependencies = `brew deps #{canonical_formula_name}`.split("\n")
|
||||||
dependencies -= `brew list`.split("\n")
|
dependencies -= `brew list`.split("\n")
|
||||||
unchanged_dependencies = dependencies - @formulae
|
unchanged_dependencies = dependencies - @formulae
|
||||||
changed_dependences = dependencies - unchanged_dependencies
|
changed_dependences = dependencies - unchanged_dependencies
|
||||||
|
|
||||||
dependents = `brew uses --skip-build --skip-optional #{formula_name}`.split("\n")
|
dependents = `brew uses --skip-build --skip-optional #{canonical_formula_name}`.split("\n")
|
||||||
dependents -= @formulae
|
dependents -= @formulae
|
||||||
dependents = dependents.map {|d| Formulary.factory(d)}
|
dependents = dependents.map {|d| Formulary.factory(d)}
|
||||||
|
|
||||||
testable_dependents = dependents.select { |d| d.test_defined? && d.bottled? }
|
testable_dependents = dependents.select { |d| d.test_defined? && d.bottled? }
|
||||||
|
|
||||||
formula = Formulary.factory(formula_name)
|
formula = Formulary.factory(canonical_formula_name)
|
||||||
installed_gcc = false
|
installed_gcc = false
|
||||||
|
|
||||||
deps = []
|
deps = []
|
||||||
@ -406,7 +412,7 @@ module Homebrew
|
|||||||
OS::Mac.clear_version_cache
|
OS::Mac.clear_version_cache
|
||||||
retry
|
retry
|
||||||
end
|
end
|
||||||
skip formula_name
|
skip canonical_formula_name
|
||||||
puts e.message
|
puts e.message
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -422,9 +428,9 @@ module Homebrew
|
|||||||
formula_fetch_options = []
|
formula_fetch_options = []
|
||||||
formula_fetch_options << "--build-bottle" unless ARGV.include? "--no-bottle"
|
formula_fetch_options << "--build-bottle" unless ARGV.include? "--no-bottle"
|
||||||
formula_fetch_options << "--force" if ARGV.include? "--cleanup"
|
formula_fetch_options << "--force" if ARGV.include? "--cleanup"
|
||||||
formula_fetch_options << formula_name
|
formula_fetch_options << canonical_formula_name
|
||||||
test "brew", "fetch", "--retry", *formula_fetch_options
|
test "brew", "fetch", "--retry", *formula_fetch_options
|
||||||
test "brew", "uninstall", "--force", formula_name if formula.installed?
|
test "brew", "uninstall", "--force", canonical_formula_name if formula.installed?
|
||||||
install_args = %w[--verbose]
|
install_args = %w[--verbose]
|
||||||
install_args << "--build-bottle" unless ARGV.include? "--no-bottle"
|
install_args << "--build-bottle" unless ARGV.include? "--no-bottle"
|
||||||
install_args << "--HEAD" if ARGV.include? "--HEAD"
|
install_args << "--HEAD" if ARGV.include? "--HEAD"
|
||||||
@ -437,19 +443,19 @@ module Homebrew
|
|||||||
install_args << "--HEAD"
|
install_args << "--HEAD"
|
||||||
end
|
end
|
||||||
|
|
||||||
install_args << formula_name
|
install_args << canonical_formula_name
|
||||||
# Don't care about e.g. bottle failures for dependencies.
|
# Don't care about e.g. bottle failures for dependencies.
|
||||||
ENV["HOMEBREW_DEVELOPER"] = nil
|
ENV["HOMEBREW_DEVELOPER"] = nil
|
||||||
test "brew", "install", "--only-dependencies", *install_args unless dependencies.empty?
|
test "brew", "install", "--only-dependencies", *install_args unless dependencies.empty?
|
||||||
ENV["HOMEBREW_DEVELOPER"] = "1"
|
ENV["HOMEBREW_DEVELOPER"] = "1"
|
||||||
test "brew", "install", *install_args
|
test "brew", "install", *install_args
|
||||||
install_passed = steps.last.passed?
|
install_passed = steps.last.passed?
|
||||||
audit_args = [formula_name]
|
audit_args = [canonical_formula_name]
|
||||||
audit_args << "--strict" if @added_formulae.include? formula_name
|
audit_args << "--strict" if @added_formulae.include? formula_name
|
||||||
test "brew", "audit", *audit_args
|
test "brew", "audit", *audit_args
|
||||||
if install_passed
|
if install_passed
|
||||||
if formula.stable? && !ARGV.include?('--no-bottle')
|
if formula.stable? && !ARGV.include?('--no-bottle')
|
||||||
bottle_args = ["--rb", formula_name]
|
bottle_args = ["--rb", canonical_formula_name]
|
||||||
if @tap
|
if @tap
|
||||||
tap_user, tap_repo = @tap.split "/"
|
tap_user, tap_repo = @tap.split "/"
|
||||||
bottle_args << "--root-url=#{BottleSpecification::DEFAULT_DOMAIN}/#{Bintray.repository(@tap)}"
|
bottle_args << "--root-url=#{BottleSpecification::DEFAULT_DOMAIN}/#{Bintray.repository(@tap)}"
|
||||||
@ -460,11 +466,11 @@ module Homebrew
|
|||||||
if bottle_step.passed? and bottle_step.has_output?
|
if bottle_step.passed? and bottle_step.has_output?
|
||||||
bottle_filename =
|
bottle_filename =
|
||||||
bottle_step.output.gsub(/.*(\.\/\S+#{bottle_native_regex}).*/m, '\1')
|
bottle_step.output.gsub(/.*(\.\/\S+#{bottle_native_regex}).*/m, '\1')
|
||||||
test "brew", "uninstall", "--force", formula_name
|
test "brew", "uninstall", "--force", canonical_formula_name
|
||||||
test "brew", "install", bottle_filename
|
test "brew", "install", bottle_filename
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
test "brew", "test", "--verbose", formula_name if formula.test_defined?
|
test "brew", "test", "--verbose", canonical_formula_name if formula.test_defined?
|
||||||
testable_dependents.each do |dependent|
|
testable_dependents.each do |dependent|
|
||||||
unless dependent.installed?
|
unless dependent.installed?
|
||||||
test "brew", "fetch", "--retry", dependent.name
|
test "brew", "fetch", "--retry", dependent.name
|
||||||
@ -480,18 +486,18 @@ module Homebrew
|
|||||||
test "brew", "test", "--verbose", dependent.name
|
test "brew", "test", "--verbose", dependent.name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
test "brew", "uninstall", "--force", formula_name
|
test "brew", "uninstall", "--force", canonical_formula_name
|
||||||
end
|
end
|
||||||
|
|
||||||
if formula.devel && formula.stable? && !ARGV.include?('--HEAD') \
|
if formula.devel && formula.stable? && !ARGV.include?('--HEAD') \
|
||||||
&& satisfied_requirements?(formula, :devel)
|
&& satisfied_requirements?(formula, :devel)
|
||||||
test "brew", "fetch", "--retry", "--devel", *formula_fetch_options
|
test "brew", "fetch", "--retry", "--devel", *formula_fetch_options
|
||||||
test "brew", "install", "--devel", "--verbose", formula_name
|
test "brew", "install", "--devel", "--verbose", canonical_formula_name
|
||||||
devel_install_passed = steps.last.passed?
|
devel_install_passed = steps.last.passed?
|
||||||
test "brew", "audit", "--devel", *audit_args
|
test "brew", "audit", "--devel", *audit_args
|
||||||
if devel_install_passed
|
if devel_install_passed
|
||||||
test "brew", "test", "--devel", "--verbose", formula_name if formula.test_defined?
|
test "brew", "test", "--devel", "--verbose", canonical_formula_name if formula.test_defined?
|
||||||
test "brew", "uninstall", "--devel", "--force", formula_name
|
test "brew", "uninstall", "--devel", "--force", canonical_formula_name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
test "brew", "uninstall", "--force", *unchanged_dependencies unless unchanged_dependencies.empty?
|
test "brew", "uninstall", "--force", *unchanged_dependencies unless unchanged_dependencies.empty?
|
||||||
@ -614,6 +620,8 @@ module Homebrew
|
|||||||
tap ||= bot_argv.value('tap')
|
tap ||= bot_argv.value('tap')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
tap.gsub! /homebrew\/homebrew-/i, "Homebrew/" if tap
|
||||||
|
|
||||||
git_url = ENV['UPSTREAM_GIT_URL'] || ENV['GIT_URL']
|
git_url = ENV['UPSTREAM_GIT_URL'] || ENV['GIT_URL']
|
||||||
if !tap && git_url
|
if !tap && git_url
|
||||||
# Also can get tap from Jenkins GIT_URL.
|
# Also can get tap from Jenkins GIT_URL.
|
||||||
@ -672,7 +680,7 @@ module Homebrew
|
|||||||
if !repository.directory?
|
if !repository.directory?
|
||||||
safe_system "brew", "tap", tap
|
safe_system "brew", "tap", tap
|
||||||
else
|
else
|
||||||
safe_system "brew", "tap", "--repair"
|
quiet_system "brew", "tap", "--repair"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user