From 80bec9bcc1fc48cec8ad939fb30cec11fb1097d9 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Mon, 16 Aug 2010 09:32:16 -0700 Subject: [PATCH] brew doctor - tweak multiple volume check --- Library/Homebrew/brew_doctor.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/brew_doctor.rb b/Library/Homebrew/brew_doctor.rb index fae8939b02..689e19ba45 100644 --- a/Library/Homebrew/brew_doctor.rb +++ b/Library/Homebrew/brew_doctor.rb @@ -416,7 +416,9 @@ def check_for_multiple_volumes # Find the volumes for the TMP folder & HOMEBREW_CELLAR real_cellar = HOMEBREW_CELLAR.realpath - tmp=Pathname.new `/usr/bin/mktemp -d /tmp/homebrew-brew-doctor-XXXX`.strip + + tmp_prefix = ENV['HOMEBREW_TEMP'] || '/tmp' + tmp=Pathname.new `/usr/bin/mktemp -d #{tmp_prefix}/homebrew-brew-doctor-XXXX`.strip real_temp = tmp.realpath.parent where_cellar = volumes.which real_cellar @@ -424,10 +426,12 @@ def check_for_multiple_volumes unless where_cellar == where_temp puts <<-EOS.undent - Your Cellar and /tmp folders are on different volumes. + Your Cellar & TEMP folders are on different volumes. - Putting your Cellar and TMP folders on different volumes causes problems - for brews that install symlinks, such as Git. + OS X won't move relative symlinks across volumes unless the target file + already exists. + + Brews known to be affected by this are Git and Narwhal. You should set the "HOMEBREW_TEMP" environmental variable to a suitable folder on the same volume as your Cellar.