From af4955adfc76c234477aadbefab529022a5b1ab9 Mon Sep 17 00:00:00 2001 From: Adrian Ho Date: Tue, 18 Jan 2022 15:42:01 +0800 Subject: [PATCH] dev-cmd/bottle: clean up intermediate tar Otherwise Cellar gets cluttered. Fixes https://github.com/Homebrew/brew/issues/12744. --- Library/Homebrew/dev-cmd/bottle.rb | 1 + Library/Homebrew/test/dev-cmd/bottle_spec.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 12a67c19dc..d476a0882e 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -446,6 +446,7 @@ module Homebrew gz.write(tarfile.read(GZIP_BUFFER_SIZE)) until tarfile.eof? end gz.close + rm_f relocatable_tar_path sudo_purge end diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb index 796888ce1a..476cd816da 100644 --- a/Library/Homebrew/test/dev-cmd/bottle_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb @@ -21,6 +21,7 @@ describe "brew bottle" do .to output(/testball--0\.1.*\.bottle\.tar\.gz/).to_stdout .and not_to_output.to_stderr .and be_a_success + expect(HOMEBREW_CELLAR/"testball-bottle.tar").not_to exist ensure FileUtils.rm_f Dir.glob("testball--0.1*.bottle.tar.gz") end