Merge pull request #1100 from MikeMcQuaid/test-bot-etc-var
test-bot: cleanup etc/var after each build.
This commit is contained in:
commit
8724e11a6b
@ -744,7 +744,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def cleanup_git
|
def cleanup_shared
|
||||||
git "gc", "--auto"
|
git "gc", "--auto"
|
||||||
test "git", "clean", "-ffdx", "--exclude=Library/Taps"
|
test "git", "clean", "-ffdx", "--exclude=Library/Taps"
|
||||||
|
|
||||||
@ -754,8 +754,8 @@ module Homebrew
|
|||||||
safe_system "brew", "untap", tap
|
safe_system "brew", "untap", tap
|
||||||
end
|
end
|
||||||
|
|
||||||
Formula.installed.each do |formula|
|
Dir.glob("#{HOMEBREW_PREFIX}/{Cellar,etc,var}/**/*").each do |file|
|
||||||
safe_system "brew", "uninstall", "--force", formula
|
FileUtils.rm_rf file
|
||||||
end
|
end
|
||||||
safe_system "brew", "prune"
|
safe_system "brew", "prune"
|
||||||
|
|
||||||
@ -787,7 +787,7 @@ module Homebrew
|
|||||||
git "reset", "--hard", "origin/master"
|
git "reset", "--hard", "origin/master"
|
||||||
end
|
end
|
||||||
|
|
||||||
cleanup_git
|
cleanup_shared
|
||||||
|
|
||||||
pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock"
|
pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock"
|
||||||
Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock }
|
Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock }
|
||||||
@ -808,7 +808,7 @@ module Homebrew
|
|||||||
git "stash", "pop"
|
git "stash", "pop"
|
||||||
test "brew", "cleanup", "--prune=7"
|
test "brew", "cleanup", "--prune=7"
|
||||||
|
|
||||||
cleanup_git
|
cleanup_shared
|
||||||
|
|
||||||
if ARGV.include? "--local"
|
if ARGV.include? "--local"
|
||||||
FileUtils.rm_rf ENV["HOMEBREW_HOME"]
|
FileUtils.rm_rf ENV["HOMEBREW_HOME"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user