Merge pull request #1251 from MikeMcQuaid/diagnostic-no-write-tmp

diagnostic: handle HOMEBREW_TEMP mktmpdir failure.
This commit is contained in:
Mike McQuaid 2016-10-09 15:26:31 +01:00 committed by GitHub
commit 0546d90e3d

View File

@ -644,13 +644,18 @@ module Homebrew
real_cellar = HOMEBREW_CELLAR.realpath real_cellar = HOMEBREW_CELLAR.realpath
where_cellar = volumes.which real_cellar where_cellar = volumes.which real_cellar
tmp = Pathname.new(Dir.mktmpdir("doctor", HOMEBREW_TEMP))
begin begin
real_tmp = tmp.realpath.parent tmp = Pathname.new(Dir.mktmpdir("doctor", HOMEBREW_TEMP))
where_tmp = volumes.which real_tmp begin
ensure real_tmp = tmp.realpath.parent
Dir.delete tmp where_tmp = volumes.which real_tmp
ensure
Dir.delete tmp
end
rescue
return
end end
return if where_cellar == where_tmp return if where_cellar == where_tmp
<<-EOS.undent <<-EOS.undent