diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2014-04-25 11:31:09 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2014-04-25 14:48:42 -0700 |
commit | 07ef48a036c6bfb661e10b38ece655b929510269 (patch) | |
tree | 52150253d52c1ea5cb9f997d88051892ceb3de62 | |
parent | c2d1478a7c11d6b13f4e39e1ae4e47c12cf5fd3d (diff) | |
download | spack-07ef48a036c6bfb661e10b38ece655b929510269.tar.gz spack-07ef48a036c6bfb661e10b38ece655b929510269.tar.bz2 spack-07ef48a036c6bfb661e10b38ece655b929510269.tar.xz spack-07ef48a036c6bfb661e10b38ece655b929510269.zip |
Better temp directory selection.
- Prefer tempfile.gettempdir(), then LC dirs like /nfs/tmp2
-rw-r--r-- | lib/spack/spack/globals.py | 9 |
1 files changed, 6 insertions, 3 deletions
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 |