diff options
Diffstat (limited to 'lib/spack/spack/__init__.py')
-rw-r--r-- | lib/spack/spack/__init__.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py index abbf3cc87b..c9c29a32cc 100644 --- a/lib/spack/spack/__init__.py +++ b/lib/spack/spack/__init__.py @@ -1,3 +1,4 @@ +# flake8: noqa ############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. @@ -50,8 +51,15 @@ repos_path = join_path(var_path, "repos") share_path = join_path(spack_root, "share", "spack") cache_path = join_path(var_path, "cache") +# User configuration location +user_config_path = os.path.expanduser('~/.spack') + import spack.fetch_strategy -cache = spack.fetch_strategy.FsCache(cache_path) +fetch_cache = spack.fetch_strategy.FsCache(cache_path) + +from spack.file_cache import FileCache +user_cache_path = join_path(user_config_path, 'cache') +user_cache = FileCache(user_cache_path) prefix = spack_root opt_path = join_path(prefix, "opt") @@ -140,7 +148,7 @@ _tmp_user = getpass.getuser() _tmp_candidates = (_default_tmp, '/nfs/tmp2', '/tmp', '/var/tmp') for path in _tmp_candidates: # don't add a second username if it's already unique by user. - if not _tmp_user in path: + if _tmp_user not in path: tmp_dirs.append(join_path(path, '%u', 'spack-stage')) else: tmp_dirs.append(join_path(path, 'spack-stage')) @@ -172,9 +180,10 @@ sys_type = None # Spack internal code should call 'import spack' and accesses other # variables (spack.repo, paths, etc.) directly. # -# TODO: maybe this should be separated out and should go in build_environment.py? -# TODO: it's not clear where all the stuff that needs to be included in packages -# should live. This file is overloaded for spack core vs. for packages. +# TODO: maybe this should be separated out to build_environment.py? +# TODO: it's not clear where all the stuff that needs to be included in +# packages should live. This file is overloaded for spack core vs. +# for packages. # __all__ = ['Package', 'CMakePackage', @@ -204,8 +213,8 @@ from spack.util.executable import * __all__ += spack.util.executable.__all__ from spack.package import \ - install_dependency_symlinks, flatten_dependencies, DependencyConflictError, \ - InstallError, ExternalPackageError + install_dependency_symlinks, flatten_dependencies, \ + DependencyConflictError, InstallError, ExternalPackageError __all__ += [ - 'install_dependency_symlinks', 'flatten_dependencies', 'DependencyConflictError', - 'InstallError', 'ExternalPackageError'] + 'install_dependency_symlinks', 'flatten_dependencies', + 'DependencyConflictError', 'InstallError', 'ExternalPackageError'] |