test-bot: tweak cleaning behaviour again.

Always run `git clean -ffdx` on HOMEBREW_REPOSITORY. Also, ensure that
if we can't find a formula that's logged.
This commit is contained in:
Mike McQuaid 2016-09-06 12:00:08 +01:00
parent f64befdd78
commit b21d724618

View File

@ -251,7 +251,9 @@ module Homebrew
raise if e.tap.installed? raise if e.tap.installed?
test "brew", "tap", e.tap.name test "brew", "tap", e.tap.name
retry unless steps.last.failed? retry unless steps.last.failed?
rescue FormulaUnavailableError, TapFormulaAmbiguityError, TapFormulaWithOldnameAmbiguityError rescue FormulaUnavailableError, TapFormulaAmbiguityError, TapFormulaWithOldnameAmbiguityError => e
onoe e
puts e.backtrace
end end
def git(*args) def git(*args)
@ -689,7 +691,15 @@ module Homebrew
end end
git "clean", "-ffdx" git "clean", "-ffdx"
Pathname.glob("{#{HOMEBREW_REPOSITORY},#{HOMEBREW_LIBRARY}/Taps/*/*}").each do |git_repo| unless @repository == HOMEBREW_REPOSITORY
HOMEBREW_REPOSITORY.cd do
safe_system "git", "checkout", "-f", "master"
safe_system "git", "reset", "--hard", "origin/master"
safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/"
end
end
Pathname.glob("#{HOMEBREW_LIBRARY}/Taps/*/*").each do |git_repo|
next if @repository == git_repo next if @repository == git_repo
git_repo.cd do git_repo.cd do
safe_system "git", "checkout", "-f", "master" safe_system "git", "checkout", "-f", "master"
@ -720,7 +730,15 @@ module Homebrew
Tap.names.each { |s| safe_system "brew", "untap", s if s != "homebrew/core" } Tap.names.each { |s| safe_system "brew", "untap", s if s != "homebrew/core" }
Pathname.glob("{#{HOMEBREW_REPOSITORY},#{HOMEBREW_LIBRARY}/Taps/*/*}").each do |git_repo| unless @repository == HOMEBREW_REPOSITORY
HOMEBREW_REPOSITORY.cd do
safe_system "git", "checkout", "-f", "master"
safe_system "git", "reset", "--hard", "origin/master"
safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/"
end
end
Pathname.glob("#{HOMEBREW_LIBRARY}/Taps/*/*").each do |git_repo|
next if @repository == git_repo next if @repository == git_repo
git_repo.cd do git_repo.cd do
safe_system "git", "checkout", "-f", "master" safe_system "git", "checkout", "-f", "master"