Skip to content

Commit

Permalink
Merge pull request Homebrew#1251 from MikeMcQuaid/diagnostic-no-write…
Browse files Browse the repository at this point in the history
…-tmp

diagnostic: handle HOMEBREW_TEMP mktmpdir failure.
  • Loading branch information
MikeMcQuaid committed Oct 9, 2016
2 parents 0c193c3 + 21ff82b commit 0546d90
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Library/Homebrew/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,18 @@ def check_for_multiple_volumes
real_cellar = HOMEBREW_CELLAR.realpath
where_cellar = volumes.which real_cellar

tmp = Pathname.new(Dir.mktmpdir("doctor", HOMEBREW_TEMP))
begin
real_tmp = tmp.realpath.parent
where_tmp = volumes.which real_tmp
ensure
Dir.delete tmp
tmp = Pathname.new(Dir.mktmpdir("doctor", HOMEBREW_TEMP))
begin
real_tmp = tmp.realpath.parent
where_tmp = volumes.which real_tmp
ensure
Dir.delete tmp
end
rescue
return
end

return if where_cellar == where_tmp

<<-EOS.undent
Expand Down

0 comments on commit 0546d90

Please sign in to comment.