summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2015-11-23 17:50:49 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2015-11-23 17:50:49 -0800
commitcf3d236b9f8177b64aad311655542a848eebbf81 (patch)
tree216c2013caf8c3bf8c793360ad14f14b94477125 /bin
parentbddab5e48947a4b02b1e37c66e8700e5d05e85a5 (diff)
parent894fcd90e7cc9c080e639f846a02b683ff29c17b (diff)
downloadspack-cf3d236b9f8177b64aad311655542a848eebbf81.tar.gz
spack-cf3d236b9f8177b64aad311655542a848eebbf81.tar.bz2
spack-cf3d236b9f8177b64aad311655542a848eebbf81.tar.xz
spack-cf3d236b9f8177b64aad311655542a848eebbf81.zip
Merge branch 'scheibelp-features/externaldeps' into develop
Diffstat (limited to 'bin')
-rwxr-xr-xbin/spack17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/spack b/bin/spack
index 127a85f6fe..e92d7cc273 100755
--- a/bin/spack
+++ b/bin/spack
@@ -38,6 +38,23 @@ SPACK_PREFIX = os.path.dirname(os.path.dirname(SPACK_FILE))
# Allow spack libs to be imported in our scripts
SPACK_LIB_PATH = os.path.join(SPACK_PREFIX, "lib", "spack")
sys.path.insert(0, SPACK_LIB_PATH)
+SPACK_EXTERNAL_LIBS = os.path.join(SPACK_LIB_PATH, "external")
+sys.path.insert(0, SPACK_EXTERNAL_LIBS)
+
+# Quick and dirty check to clean orphaned .pyc files left over from
+# previous revisions. These files were present in earlier versions of
+# Spack, were removed, but shadow system modules that Spack still
+# imports. If we leave them, Spack will fail in mysterious ways.
+# TODO: more elegant solution for orphaned pyc files.
+orphaned_pyc_files = [os.path.join(SPACK_EXTERNAL_LIBS, n)
+ for n in ('functools.pyc', 'ordereddict.pyc')]
+for pyc_file in orphaned_pyc_files:
+ if not os.path.exists(pyc_file):
+ continue
+ try:
+ os.remove(pyc_file)
+ except OSError as e:
+ print "WARNING: Spack may fail mysteriously. Couldn't remove orphaned .pyc file: %s" % pyc
# If there is no working directory, use the spack prefix.
try: