Fix mktmp to be generic as-per SUS/BSD.

Closes Homebrew/homebrew#31586.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
xxxajk 2014-08-14 02:04:34 -04:00 committed by Mike McQuaid
parent c7444d34f7
commit 1dc384b4c4
2 changed files with 2 additions and 2 deletions

View File

@ -700,7 +700,7 @@ def check_for_multiple_volumes
# Find the volumes for the TMP folder & HOMEBREW_CELLAR # Find the volumes for the TMP folder & HOMEBREW_CELLAR
real_cellar = HOMEBREW_CELLAR.realpath real_cellar = HOMEBREW_CELLAR.realpath
tmp = Pathname.new with_system_path { `mktemp -d #{HOMEBREW_TEMP}/homebrew-brew-doctor-XXXX` }.strip tmp = Pathname.new with_system_path { `mktemp -d #{HOMEBREW_TEMP}/homebrew-brew-doctor-XXXXXX` }.strip
real_temp = tmp.realpath.parent real_temp = tmp.realpath.parent
where_cellar = volumes.which real_cellar where_cellar = volumes.which real_cellar

View File

@ -14,7 +14,7 @@ module FileUtils
# /tmp volume to the other volume. So we let the user override the tmp # /tmp volume to the other volume. So we let the user override the tmp
# prefix if they need to. # prefix if they need to.
tempd = with_system_path { `mktemp -d #{HOMEBREW_TEMP}/#{prefix}-XXXX` }.chuzzle tempd = with_system_path { `mktemp -d #{HOMEBREW_TEMP}/#{prefix}-XXXXXX` }.chuzzle
raise "Failed to create sandbox" if tempd.nil? raise "Failed to create sandbox" if tempd.nil?
prevd = pwd prevd = pwd
cd tempd cd tempd