From 81dc27bf411c7417604ca3ebb344ff82f8d3e7d9 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 16 Mar 2014 16:03:49 -0700 Subject: Move packages and mock packages to /var/spack --- bin/spack | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bin') 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: -- cgit v1.2.3-70-g09d2