Skip to content

Commit 28a3cec

Browse files
committed
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.
1 parent 889c400 commit 28a3cec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Library/Homebrew/dev-cmd/test-bot.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ def homebrew
749749
end
750750
end
751751

752-
def cleanup_git
752+
def cleanup_shared
753753
git "gc", "--auto"
754754
test "git", "clean", "-ffdx", "--exclude=Library/Taps"
755755

@@ -759,8 +759,8 @@ def cleanup_git
759759
safe_system "brew", "untap", tap
760760
end
761761

762-
Formula.installed.each do |formula|
763-
safe_system "brew", "uninstall", "--force", formula
762+
Dir.glob("#{HOMEBREW_PREFIX}/{Cellar,etc,var}/**/*").each do |file|
763+
FileUtils.rm_rf file
764764
end
765765
safe_system "brew", "prune"
766766

@@ -792,7 +792,7 @@ def cleanup_before
792792
git "reset", "--hard", "origin/master"
793793
end
794794

795-
cleanup_git
795+
cleanup_shared
796796

797797
pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock"
798798
Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock }
@@ -813,7 +813,7 @@ def cleanup_after
813813
git "stash", "pop"
814814
test "brew", "cleanup", "--prune=7"
815815

816-
cleanup_git
816+
cleanup_shared
817817

818818
if ARGV.include? "--local"
819819
FileUtils.rm_rf ENV["HOMEBREW_HOME"]

0 commit comments

Comments
 (0)