summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/spack10
-rw-r--r--lib/spack/spack/globals.py7
-rw-r--r--lib/spack/spack/packages.py (renamed from lib/spack/spack/packages/__init__.py)4
-rw-r--r--lib/spack/spack/test/mock_packages_test.py7
-rw-r--r--lib/spack/spack/test/packages.py7
-rw-r--r--var/spack/mock_packages/callpath/package.py (renamed from lib/spack/spack/test/mock_packages/callpath/package.py)0
-rw-r--r--var/spack/mock_packages/direct_mpich/package.py (renamed from lib/spack/spack/test/mock_packages/direct_mpich/package.py)0
-rw-r--r--var/spack/mock_packages/dyninst/package.py (renamed from lib/spack/spack/test/mock_packages/dyninst/package.py)0
-rw-r--r--var/spack/mock_packages/fake/package.py (renamed from lib/spack/spack/test/mock_packages/fake/package.py)0
-rw-r--r--var/spack/mock_packages/indirect_mpich/package.py (renamed from lib/spack/spack/test/mock_packages/indirect_mpich/package.py)0
-rw-r--r--var/spack/mock_packages/libdwarf/package.py (renamed from lib/spack/spack/test/mock_packages/libdwarf/package.py)0
-rw-r--r--var/spack/mock_packages/libelf/package.py (renamed from lib/spack/spack/test/mock_packages/libelf/package.py)0
-rw-r--r--var/spack/mock_packages/mpich/package.py (renamed from lib/spack/spack/test/mock_packages/mpich/package.py)0
-rw-r--r--var/spack/mock_packages/mpich2/package.py (renamed from lib/spack/spack/test/mock_packages/mpich2/package.py)0
-rw-r--r--var/spack/mock_packages/mpileaks/package.py (renamed from lib/spack/spack/test/mock_packages/mpileaks/package.py)0
-rw-r--r--var/spack/mock_packages/multimethod/package.py (renamed from lib/spack/spack/test/mock_packages/multimethod/package.py)0
-rw-r--r--var/spack/mock_packages/trivial_install_test_package/package.py (renamed from lib/spack/spack/test/mock_packages/trivial_install_test_package/package.py)0
-rw-r--r--var/spack/mock_packages/zmpi/package.py (renamed from lib/spack/spack/test/mock_packages/zmpi/package.py)0
-rw-r--r--var/spack/packages/callpath/package.py (renamed from lib/spack/spack/packages/callpath/package.py)0
-rw-r--r--var/spack/packages/cmake/package.py (renamed from lib/spack/spack/packages/cmake/package.py)0
-rw-r--r--var/spack/packages/dyninst/package.py (renamed from lib/spack/spack/packages/dyninst/package.py)0
-rw-r--r--var/spack/packages/graphlib/package.py (renamed from lib/spack/spack/packages/graphlib/package.py)0
-rw-r--r--var/spack/packages/launchmon/package.py (renamed from lib/spack/spack/packages/launchmon/package.py)0
-rw-r--r--var/spack/packages/launchmon/patch.lmon_install_dir (renamed from lib/spack/spack/packages/launchmon/patch.lmon_install_dir)0
-rw-r--r--var/spack/packages/libdwarf/package.py (renamed from lib/spack/spack/packages/libdwarf/package.py)0
-rw-r--r--var/spack/packages/libelf/package.py (renamed from lib/spack/spack/packages/libelf/package.py)0
-rw-r--r--var/spack/packages/libunwind/package.py (renamed from lib/spack/spack/packages/libunwind/package.py)0
-rw-r--r--var/spack/packages/mpich/package.py (renamed from lib/spack/spack/packages/mpich/package.py)0
-rw-r--r--var/spack/packages/mpileaks/package.py (renamed from lib/spack/spack/packages/mpileaks/package.py)0
-rw-r--r--var/spack/packages/mrnet/package.py (renamed from lib/spack/spack/packages/mrnet/package.py)0
-rw-r--r--var/spack/packages/mvapich2/ad_lustre_rwcontig_open_source.patch (renamed from lib/spack/spack/packages/mvapich2/ad_lustre_rwcontig_open_source.patch)0
-rw-r--r--var/spack/packages/mvapich2/package.py (renamed from lib/spack/spack/packages/mvapich2/package.py)0
-rw-r--r--var/spack/packages/openmpi/ad_lustre_rwcontig_open_source.patch (renamed from lib/spack/spack/packages/openmpi/ad_lustre_rwcontig_open_source.patch)0
-rw-r--r--var/spack/packages/openmpi/llnl-platforms.patch (renamed from lib/spack/spack/packages/openmpi/llnl-platforms.patch)0
-rw-r--r--var/spack/packages/openmpi/package.py (renamed from lib/spack/spack/packages/openmpi/package.py)0
-rw-r--r--var/spack/packages/pmgr_collective/package.py (renamed from lib/spack/spack/packages/pmgr_collective/package.py)0
-rw-r--r--var/spack/packages/scr/package.py (renamed from lib/spack/spack/packages/scr/package.py)0
-rw-r--r--var/spack/packages/spindle/package.py (renamed from lib/spack/spack/packages/spindle/package.py)0
-rw-r--r--var/spack/packages/stat/package.py (renamed from lib/spack/spack/packages/stat/package.py)0
39 files changed, 18 insertions, 17 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:
diff --git a/lib/spack/spack/globals.py b/lib/spack/spack/globals.py
index 20801447fa..4ff50a3e7e 100644
--- a/lib/spack/spack/globals.py
+++ b/lib/spack/spack/globals.py
@@ -53,8 +53,13 @@ install_path = join_path(prefix, "opt")
#
# Set up the packages database.
#
-db = PackageDB(join_path(module_path, "packages"))
+packages_path = join_path(var_path, "packages")
+db = PackageDB(packages_path)
+#
+# This is the path to mock packages used by spack for testing.
+#
+mock_packages_path = join_path(var_path, "mock_packages")
#
# This controls how spack lays out install prefixes and
diff --git a/lib/spack/spack/packages/__init__.py b/lib/spack/spack/packages.py
index beb8ecf6ab..732ced9bf2 100644
--- a/lib/spack/spack/packages/__init__.py
+++ b/lib/spack/spack/packages.py
@@ -200,10 +200,6 @@ class PackageDB(object):
else:
raise UnknownPackageError(pkg_name)
- # Figure out pacakges module based on self.root
- if not re.match(r'%s' % spack.module_path, self.root):
- raise RuntimeError("Packages path is not a submodule of spack.")
-
class_name = class_name_for_package_name(pkg_name)
try:
module_name = _imported_packages_module + '.' + pkg_name
diff --git a/lib/spack/spack/test/mock_packages_test.py b/lib/spack/spack/test/mock_packages_test.py
index f300995d7e..e9a8113c09 100644
--- a/lib/spack/spack/test/mock_packages_test.py
+++ b/lib/spack/spack/test/mock_packages_test.py
@@ -24,15 +24,10 @@
##############################################################################
import unittest
-from llnl.util.lang import list_modules
-from llnl.util.filesystem import join_path
-
import spack
from spack.packages import PackageDB
from spack.spec import Spec
-mock_packages_path = join_path(spack.module_path, 'test', 'mock_packages')
-
def set_pkg_dep(pkg, spec):
"""Alters dependence information for a pacakge.
Use this to mock up constraints.
@@ -48,7 +43,7 @@ class MockPackagesTest(unittest.TestCase):
# us to set up contrived packages that don't interfere with
# real ones.
self.real_db = spack.db
- spack.db = PackageDB(mock_packages_path)
+ spack.db = PackageDB(spack.mock_packages_path)
@classmethod
diff --git a/lib/spack/spack/test/packages.py b/lib/spack/spack/test/packages.py
index 146700948f..1b2e0ab07a 100644
--- a/lib/spack/spack/test/packages.py
+++ b/lib/spack/spack/test/packages.py
@@ -24,9 +24,10 @@
##############################################################################
import unittest
+from llnl.util.filesystem import join_path
+
import spack
import spack.packages as packages
-
from spack.test.mock_packages_test import *
@@ -43,7 +44,7 @@ class PackagesTest(MockPackagesTest):
def test_package_filename(self):
filename = spack.db.filename_for_package_name('mpich')
- self.assertEqual(filename, join_path(mock_packages_path, 'mpich', 'package.py'))
+ self.assertEqual(filename, join_path(spack.mock_packages_path, 'mpich', 'package.py'))
def test_package_name(self):
@@ -53,7 +54,7 @@ class PackagesTest(MockPackagesTest):
def test_nonexisting_package_filename(self):
filename = spack.db.filename_for_package_name('some-nonexisting-package')
- self.assertEqual(filename, join_path(mock_packages_path, 'some-nonexisting-package', 'package.py'))
+ self.assertEqual(filename, join_path(spack.mock_packages_path, 'some-nonexisting-package', 'package.py'))
def test_package_class_names(self):
diff --git a/lib/spack/spack/test/mock_packages/callpath/package.py b/var/spack/mock_packages/callpath/package.py
index b4fd0f4482..b4fd0f4482 100644
--- a/lib/spack/spack/test/mock_packages/callpath/package.py
+++ b/var/spack/mock_packages/callpath/package.py
diff --git a/lib/spack/spack/test/mock_packages/direct_mpich/package.py b/var/spack/mock_packages/direct_mpich/package.py
index d702e4481b..d702e4481b 100644
--- a/lib/spack/spack/test/mock_packages/direct_mpich/package.py
+++ b/var/spack/mock_packages/direct_mpich/package.py
diff --git a/lib/spack/spack/test/mock_packages/dyninst/package.py b/var/spack/mock_packages/dyninst/package.py
index d32c4b5504..d32c4b5504 100644
--- a/lib/spack/spack/test/mock_packages/dyninst/package.py
+++ b/var/spack/mock_packages/dyninst/package.py
diff --git a/lib/spack/spack/test/mock_packages/fake/package.py b/var/spack/mock_packages/fake/package.py
index 88bc6d8669..88bc6d8669 100644
--- a/lib/spack/spack/test/mock_packages/fake/package.py
+++ b/var/spack/mock_packages/fake/package.py
diff --git a/lib/spack/spack/test/mock_packages/indirect_mpich/package.py b/var/spack/mock_packages/indirect_mpich/package.py
index a53cb9330c..a53cb9330c 100644
--- a/lib/spack/spack/test/mock_packages/indirect_mpich/package.py
+++ b/var/spack/mock_packages/indirect_mpich/package.py
diff --git a/lib/spack/spack/test/mock_packages/libdwarf/package.py b/var/spack/mock_packages/libdwarf/package.py
index 0f4d55fd88..0f4d55fd88 100644
--- a/lib/spack/spack/test/mock_packages/libdwarf/package.py
+++ b/var/spack/mock_packages/libdwarf/package.py
diff --git a/lib/spack/spack/test/mock_packages/libelf/package.py b/var/spack/mock_packages/libelf/package.py
index 5ac07de4e3..5ac07de4e3 100644
--- a/lib/spack/spack/test/mock_packages/libelf/package.py
+++ b/var/spack/mock_packages/libelf/package.py
diff --git a/lib/spack/spack/test/mock_packages/mpich/package.py b/var/spack/mock_packages/mpich/package.py
index 2a8e1cebe3..2a8e1cebe3 100644
--- a/lib/spack/spack/test/mock_packages/mpich/package.py
+++ b/var/spack/mock_packages/mpich/package.py
diff --git a/lib/spack/spack/test/mock_packages/mpich2/package.py b/var/spack/mock_packages/mpich2/package.py
index 84dce4cccb..84dce4cccb 100644
--- a/lib/spack/spack/test/mock_packages/mpich2/package.py
+++ b/var/spack/mock_packages/mpich2/package.py
diff --git a/lib/spack/spack/test/mock_packages/mpileaks/package.py b/var/spack/mock_packages/mpileaks/package.py
index c34d5991e6..c34d5991e6 100644
--- a/lib/spack/spack/test/mock_packages/mpileaks/package.py
+++ b/var/spack/mock_packages/mpileaks/package.py
diff --git a/lib/spack/spack/test/mock_packages/multimethod/package.py b/var/spack/mock_packages/multimethod/package.py
index 75b1606ffc..75b1606ffc 100644
--- a/lib/spack/spack/test/mock_packages/multimethod/package.py
+++ b/var/spack/mock_packages/multimethod/package.py
diff --git a/lib/spack/spack/test/mock_packages/trivial_install_test_package/package.py b/var/spack/mock_packages/trivial_install_test_package/package.py
index b665825b32..b665825b32 100644
--- a/lib/spack/spack/test/mock_packages/trivial_install_test_package/package.py
+++ b/var/spack/mock_packages/trivial_install_test_package/package.py
diff --git a/lib/spack/spack/test/mock_packages/zmpi/package.py b/var/spack/mock_packages/zmpi/package.py
index a86bd706bb..a86bd706bb 100644
--- a/lib/spack/spack/test/mock_packages/zmpi/package.py
+++ b/var/spack/mock_packages/zmpi/package.py
diff --git a/lib/spack/spack/packages/callpath/package.py b/var/spack/packages/callpath/package.py
index 5d92d77302..5d92d77302 100644
--- a/lib/spack/spack/packages/callpath/package.py
+++ b/var/spack/packages/callpath/package.py
diff --git a/lib/spack/spack/packages/cmake/package.py b/var/spack/packages/cmake/package.py
index 70406610b6..70406610b6 100644
--- a/lib/spack/spack/packages/cmake/package.py
+++ b/var/spack/packages/cmake/package.py
diff --git a/lib/spack/spack/packages/dyninst/package.py b/var/spack/packages/dyninst/package.py
index 2318317de5..2318317de5 100644
--- a/lib/spack/spack/packages/dyninst/package.py
+++ b/var/spack/packages/dyninst/package.py
diff --git a/lib/spack/spack/packages/graphlib/package.py b/var/spack/packages/graphlib/package.py
index c959135147..c959135147 100644
--- a/lib/spack/spack/packages/graphlib/package.py
+++ b/var/spack/packages/graphlib/package.py
diff --git a/lib/spack/spack/packages/launchmon/package.py b/var/spack/packages/launchmon/package.py
index e2b82610fd..e2b82610fd 100644
--- a/lib/spack/spack/packages/launchmon/package.py
+++ b/var/spack/packages/launchmon/package.py
diff --git a/lib/spack/spack/packages/launchmon/patch.lmon_install_dir b/var/spack/packages/launchmon/patch.lmon_install_dir
index 8a1d93fdc9..8a1d93fdc9 100644
--- a/lib/spack/spack/packages/launchmon/patch.lmon_install_dir
+++ b/var/spack/packages/launchmon/patch.lmon_install_dir
diff --git a/lib/spack/spack/packages/libdwarf/package.py b/var/spack/packages/libdwarf/package.py
index 657e84705a..657e84705a 100644
--- a/lib/spack/spack/packages/libdwarf/package.py
+++ b/var/spack/packages/libdwarf/package.py
diff --git a/lib/spack/spack/packages/libelf/package.py b/var/spack/packages/libelf/package.py
index f663ba750d..f663ba750d 100644
--- a/lib/spack/spack/packages/libelf/package.py
+++ b/var/spack/packages/libelf/package.py
diff --git a/lib/spack/spack/packages/libunwind/package.py b/var/spack/packages/libunwind/package.py
index c93b5b2c98..c93b5b2c98 100644
--- a/lib/spack/spack/packages/libunwind/package.py
+++ b/var/spack/packages/libunwind/package.py
diff --git a/lib/spack/spack/packages/mpich/package.py b/var/spack/packages/mpich/package.py
index af9e8266dc..af9e8266dc 100644
--- a/lib/spack/spack/packages/mpich/package.py
+++ b/var/spack/packages/mpich/package.py
diff --git a/lib/spack/spack/packages/mpileaks/package.py b/var/spack/packages/mpileaks/package.py
index 3307b9fdee..3307b9fdee 100644
--- a/lib/spack/spack/packages/mpileaks/package.py
+++ b/var/spack/packages/mpileaks/package.py
diff --git a/lib/spack/spack/packages/mrnet/package.py b/var/spack/packages/mrnet/package.py
index 15d851f83e..15d851f83e 100644
--- a/lib/spack/spack/packages/mrnet/package.py
+++ b/var/spack/packages/mrnet/package.py
diff --git a/lib/spack/spack/packages/mvapich2/ad_lustre_rwcontig_open_source.patch b/var/spack/packages/mvapich2/ad_lustre_rwcontig_open_source.patch
index ff85845cf8..ff85845cf8 100644
--- a/lib/spack/spack/packages/mvapich2/ad_lustre_rwcontig_open_source.patch
+++ b/var/spack/packages/mvapich2/ad_lustre_rwcontig_open_source.patch
diff --git a/lib/spack/spack/packages/mvapich2/package.py b/var/spack/packages/mvapich2/package.py
index f372679f49..f372679f49 100644
--- a/lib/spack/spack/packages/mvapich2/package.py
+++ b/var/spack/packages/mvapich2/package.py
diff --git a/lib/spack/spack/packages/openmpi/ad_lustre_rwcontig_open_source.patch b/var/spack/packages/openmpi/ad_lustre_rwcontig_open_source.patch
index daa825ccbe..daa825ccbe 100644
--- a/lib/spack/spack/packages/openmpi/ad_lustre_rwcontig_open_source.patch
+++ b/var/spack/packages/openmpi/ad_lustre_rwcontig_open_source.patch
diff --git a/lib/spack/spack/packages/openmpi/llnl-platforms.patch b/var/spack/packages/openmpi/llnl-platforms.patch
index f515743c4d..f515743c4d 100644
--- a/lib/spack/spack/packages/openmpi/llnl-platforms.patch
+++ b/var/spack/packages/openmpi/llnl-platforms.patch
diff --git a/lib/spack/spack/packages/openmpi/package.py b/var/spack/packages/openmpi/package.py
index f24a66c12e..f24a66c12e 100644
--- a/lib/spack/spack/packages/openmpi/package.py
+++ b/var/spack/packages/openmpi/package.py
diff --git a/lib/spack/spack/packages/pmgr_collective/package.py b/var/spack/packages/pmgr_collective/package.py
index 0874e2d17b..0874e2d17b 100644
--- a/lib/spack/spack/packages/pmgr_collective/package.py
+++ b/var/spack/packages/pmgr_collective/package.py
diff --git a/lib/spack/spack/packages/scr/package.py b/var/spack/packages/scr/package.py
index cb908e830e..cb908e830e 100644
--- a/lib/spack/spack/packages/scr/package.py
+++ b/var/spack/packages/scr/package.py
diff --git a/lib/spack/spack/packages/spindle/package.py b/var/spack/packages/spindle/package.py
index 0d106221d8..0d106221d8 100644
--- a/lib/spack/spack/packages/spindle/package.py
+++ b/var/spack/packages/spindle/package.py
diff --git a/lib/spack/spack/packages/stat/package.py b/var/spack/packages/stat/package.py
index d621bcef01..d621bcef01 100644
--- a/lib/spack/spack/packages/stat/package.py
+++ b/var/spack/packages/stat/package.py