summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2014-03-16 16:03:49 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2014-03-16 17:05:15 -0700
commit81dc27bf411c7417604ca3ebb344ff82f8d3e7d9 (patch)
tree989c8e4a64c8ecd3444df5547529daed7c6fde88 /bin
parent566dc037e7151f814bb9cd4c847c5a5a2184c2e9 (diff)
downloadspack-81dc27bf411c7417604ca3ebb344ff82f8d3e7d9.tar.gz
spack-81dc27bf411c7417604ca3ebb344ff82f8d3e7d9.tar.bz2
spack-81dc27bf411c7417604ca3ebb344ff82f8d3e7d9.tar.xz
spack-81dc27bf411c7417604ca3ebb344ff82f8d3e7d9.zip
Move packages and mock packages to /var/spack
Diffstat (limited to 'bin')
-rwxr-xr-xbin/spack10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/spack b/bin/spack
index 60a2ef4c3a..b922fc5479 100755
--- a/bin/spack
+++ b/bin/spack
@@ -39,6 +39,12 @@ SPACK_PREFIX = os.path.dirname(os.path.dirname(SPACK_FILE))
SPACK_LIB_PATH = os.path.join(SPACK_PREFIX, "lib", "spack")
sys.path.insert(0, SPACK_LIB_PATH)
+# If there is no working directory, use the spack prefix.
+try:
+ os.getcwd()
+except OSError:
+ os.chdir(SPACK_PREFIX)
+
# clean up the scope and start using spack package instead.
del SPACK_FILE, SPACK_PREFIX, SPACK_LIB_PATH
import llnl.util.tty as tty
@@ -74,10 +80,8 @@ args = parser.parse_args()
spack.verbose = args.verbose
spack.debug = args.debug
if args.mock:
- from llnl.util.filesystem import join_path
from spack.packages import PackageDB
- mock_path = join_path(spack.module_path, 'test', 'mock_packages')
- spack.db = PackageDB(mock_path)
+ spack.db = PackageDB(spack.mock_packages_path)
# If the user asked for it, don't check ssl certs.
if args.insecure: