From 93132c6876a6484bae0436bdb3d93c6717bcf828 Mon Sep 17 00:00:00 2001 From: Lukas Oberhuber Date: Sun, 31 Jul 2022 20:54:14 +0100 Subject: [PATCH] Always put source files in the same directory There's no point in saving old ones because the debug symbols will only for the newest bulid anyway. Currently blows away what was there before, which isn't ideal for a dev workflow. Maybe that should be changed, given a tar file should be a tar file, so shouldn't change. But there are many different types of files. --- Library/Homebrew/mktemp.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/mktemp.rb b/Library/Homebrew/mktemp.rb index 16aa64a0d5..7a9302e419 100644 --- a/Library/Homebrew/mktemp.rb +++ b/Library/Homebrew/mktemp.rb @@ -42,12 +42,13 @@ class Mktemp def run if @retain_in_sources - root = "#{HOMEBREW_CACHE}/Sources" - FileUtils.mkdir_p root + source_dir = "#{HOMEBREW_CACHE}/Sources/#{@prefix.tr "@", "AT"}" + chmod_rm_rf(source_dir) # clear out previous (otherwise not sure what happens) + FileUtils.mkdir_p(source_dir) + @tmpdir = Pathname.new(source_dir) else - root = HOMEBREW_TEMP + @tmpdir = Pathname.new(Dir.mktmpdir("#{@prefix.tr "@", "AT"}-", HOMEBREW_TEMP)) end - @tmpdir = Pathname.new(Dir.mktmpdir("#{@prefix.tr "@", "AT"}-", root)) # Make sure files inside the temporary directory have the same group as the # brew instance.