From 07ef48a036c6bfb661e10b38ece655b929510269 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 25 Apr 2014 11:31:09 -0700 Subject: Better temp directory selection. - Prefer tempfile.gettempdir(), then LC dirs like /nfs/tmp2 --- lib/spack/spack/globals.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/globals.py b/lib/spack/spack/globals.py index 096c1334f5..9fc40845b0 100644 --- a/lib/spack/spack/globals.py +++ b/lib/spack/spack/globals.py @@ -23,6 +23,7 @@ # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## import os +import tempfile from llnl.util.filesystem import * @@ -92,9 +93,11 @@ use_tmp_stage = True # Use a %u to add a username to the stage paths here, in case this # is a shared filesystem. Spack will use the first of these paths # that it can create. -tmp_dirs = ['/nfs/tmp2/%u/spack-stage', - '/var/tmp/%u/spack-stage', - '/tmp/%u/spack-stage'] +tmp_dirs = [] +_default_tmp = tempfile.gettempdir() +if _default_tmp != os.getcwd(): + tmp_dirs.append(os.path.join(_default_tmp, 'spack-stage')) +tmp_dirs.append('/nfs/tmp2/%u/spack-stage') # Whether spack should allow installation of unsafe versions of # software. "Unsafe" versions are ones it doesn't have a checksum -- cgit v1.2.3-60-g2f50