Skip to content

Commit

Permalink
test-bot: cleanup Cellar/etc/var after each build.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MikeMcQuaid committed Sep 23, 2016
1 parent 889c400 commit 28a3cec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Library/Homebrew/dev-cmd/test-bot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ def homebrew
end
end

def cleanup_git
def cleanup_shared
git "gc", "--auto"
test "git", "clean", "-ffdx", "--exclude=Library/Taps"

Expand All @@ -759,8 +759,8 @@ def cleanup_git
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"

Expand Down Expand Up @@ -792,7 +792,7 @@ def cleanup_before
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 }
Expand All @@ -813,7 +813,7 @@ def cleanup_after
git "stash", "pop"
test "brew", "cleanup", "--prune=7"

cleanup_git
cleanup_shared

if ARGV.include? "--local"
FileUtils.rm_rf ENV["HOMEBREW_HOME"]
Expand Down

0 comments on commit 28a3cec

Please sign in to comment.