diff options
| author | Mike McQuaid | 2015-02-27 17:00:34 +0000 | 
|---|---|---|
| committer | Mike McQuaid | 2015-02-27 17:00:34 +0000 | 
| commit | f27f427d95bc181b67ee5522f4781b508e9d9df9 (patch) | |
| tree | ba1d47b61bdfa2ccbc3cb50b69dc94ae3bb2e2ed /Library/Homebrew/cmd | |
| parent | 0161d50d7a027a2ab4fbd4c83dc6ca272cab4aa3 (diff) | |
| download | brew-f27f427d95bc181b67ee5522f4781b508e9d9df9.tar.bz2 | |
test-bot: use canonical names for taps.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/test-bot.rb | 42 | 
1 files changed, 25 insertions, 17 deletions
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb index b7a9ad384..44672dd58 100644 --- a/Library/Homebrew/cmd/test-bot.rb +++ b/Library/Homebrew/cmd/test-bot.rb @@ -358,19 +358,25 @@ module Homebrew      def formula formula_name        @category = "#{__method__}.#{formula_name}" -      test "brew", "uses", formula_name -      dependencies = `brew deps #{formula_name}`.split("\n") +      canonical_formula_name = if @tap +        "#{@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")        unchanged_dependencies = dependencies - @formulae        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 = dependents.map {|d| Formulary.factory(d)}        testable_dependents = dependents.select { |d| d.test_defined? && d.bottled? } -      formula = Formulary.factory(formula_name) +      formula = Formulary.factory(canonical_formula_name)        installed_gcc = false        deps = [] @@ -406,7 +412,7 @@ module Homebrew            OS::Mac.clear_version_cache            retry          end -        skip formula_name +        skip canonical_formula_name          puts e.message          return        end @@ -422,9 +428,9 @@ module Homebrew        formula_fetch_options = []        formula_fetch_options << "--build-bottle" unless ARGV.include? "--no-bottle"        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", "uninstall", "--force", formula_name if formula.installed? +      test "brew", "uninstall", "--force", canonical_formula_name if formula.installed?        install_args = %w[--verbose]        install_args << "--build-bottle" unless ARGV.include? "--no-bottle"        install_args << "--HEAD" if ARGV.include? "--HEAD" @@ -437,19 +443,19 @@ module Homebrew          install_args << "--HEAD"        end -      install_args << formula_name +      install_args << canonical_formula_name        # Don't care about e.g. bottle failures for dependencies.        ENV["HOMEBREW_DEVELOPER"] = nil        test "brew", "install", "--only-dependencies", *install_args unless dependencies.empty?        ENV["HOMEBREW_DEVELOPER"] = "1"        test "brew", "install", *install_args        install_passed = steps.last.passed? -      audit_args = [formula_name] +      audit_args = [canonical_formula_name]        audit_args << "--strict" if @added_formulae.include? formula_name        test "brew", "audit", *audit_args        if install_passed          if formula.stable? && !ARGV.include?('--no-bottle') -          bottle_args = ["--rb", formula_name] +          bottle_args = ["--rb", canonical_formula_name]            if @tap              tap_user, tap_repo = @tap.split "/"              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?              bottle_filename =                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            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|            unless dependent.installed?              test "brew", "fetch", "--retry", dependent.name @@ -480,18 +486,18 @@ module Homebrew              test "brew", "test", "--verbose", dependent.name            end          end -        test "brew", "uninstall", "--force", formula_name +        test "brew", "uninstall", "--force", canonical_formula_name        end        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 +        test "brew", "install", "--devel", "--verbose", canonical_formula_name          devel_install_passed = steps.last.passed?          test "brew", "audit", "--devel", *audit_args          if devel_install_passed -          test "brew", "test", "--devel", "--verbose", formula_name if formula.test_defined? -          test "brew", "uninstall", "--devel", "--force", formula_name +          test "brew", "test", "--devel", "--verbose", canonical_formula_name if formula.test_defined? +          test "brew", "uninstall", "--devel", "--force", canonical_formula_name          end        end        test "brew", "uninstall", "--force", *unchanged_dependencies unless unchanged_dependencies.empty? @@ -614,6 +620,8 @@ module Homebrew        tap ||= bot_argv.value('tap')      end +    tap.gsub! /homebrew\/homebrew-/i, "Homebrew/" if tap +      git_url = ENV['UPSTREAM_GIT_URL'] || ENV['GIT_URL']      if !tap && git_url        # Also can get tap from Jenkins GIT_URL. @@ -672,7 +680,7 @@ module Homebrew        if !repository.directory?          safe_system "brew", "tap", tap        else -        safe_system "brew", "tap", "--repair" +        quiet_system "brew", "tap", "--repair"        end      end  | 
