aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/test-bot.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-09-23 14:24:41 +0100
committerMike McQuaid2016-09-23 14:24:41 +0100
commit28a3cec21a259bf3a0f8e6de846fa12be6524198 (patch)
tree7a3c236f030c1d7b80f00023b6a7bd41f9c20c74 /Library/Homebrew/dev-cmd/test-bot.rb
parent889c400be4ba7803b7dcf402b00279a21ae80c97 (diff)
downloadbrew-28a3cec21a259bf3a0f8e6de846fa12be6524198.tar.bz2
test-bot: cleanup Cellar/etc/var after each build.
This has been causing issues when bottling files that are installed to these paths due to the diff algorithm we use for figuring out whether files installed into etc/var belong to a given bottle. Additionally, sometimes not all formulae were uninstalled which meant `brew doctor` would fail.
Diffstat (limited to 'Library/Homebrew/dev-cmd/test-bot.rb')
-rw-r--r--Library/Homebrew/dev-cmd/test-bot.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb
index 7a5853c48..e7f68d4e8 100644
--- a/Library/Homebrew/dev-cmd/test-bot.rb
+++ b/Library/Homebrew/dev-cmd/test-bot.rb
@@ -749,7 +749,7 @@ module Homebrew
end
end
- def cleanup_git
+ def cleanup_shared
git "gc", "--auto"
test "git", "clean", "-ffdx", "--exclude=Library/Taps"
@@ -759,8 +759,8 @@ module Homebrew
safe_system "brew", "untap", tap
end
- Formula.installed.each do |formula|
- safe_system "brew", "uninstall", "--force", formula
+ Dir.glob("#{HOMEBREW_PREFIX}/{Cellar,etc,var}/**/*").each do |file|
+ FileUtils.rm_rf file
end
safe_system "brew", "prune"
@@ -792,7 +792,7 @@ module Homebrew
git "reset", "--hard", "origin/master"
end
- cleanup_git
+ cleanup_shared
pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock"
Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock }
@@ -813,7 +813,7 @@ module Homebrew
git "stash", "pop"
test "brew", "cleanup", "--prune=7"
- cleanup_git
+ cleanup_shared
if ARGV.include? "--local"
FileUtils.rm_rf ENV["HOMEBREW_HOME"]