Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Lukas Oberhuber 2022-08-05 16:12:39 -07:00 committed by GitHub
parent 6fbadb35e7
commit 936d363c44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,13 +47,13 @@ class Mktemp
def run
prefix_name = @prefix.tr "@", "AT"
if retain_in_cache?
source_dir = "#{HOMEBREW_CACHE}/Sources/#{prefix_name}"
@tmpdir = Pathname.new(source_dir)
chmod_rm_rf(@tmpdir) # clear out previous (otherwise not sure what happens)
FileUtils.mkdir_p(source_dir)
@tmpdir = if retain_in_cache?
tmpdir = HOMEBREW_CACHE/"Sources/#{prefix_name}"
chmod_rm_rf(tmpdir) # clear out previous staging directory
tmpdir.parent.mkpath
tmpdir
else
@tmpdir = Pathname.new(Dir.mktmpdir("#{prefix_name}-", HOMEBREW_TEMP))
Pathname.new(Dir.mktmpdir("#{prefix_name}-", HOMEBREW_TEMP))
end
# Make sure files inside the temporary directory have the same group as the