summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2015-12-25 16:35:55 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2015-12-25 16:35:55 -0800
commitc65fd3a28968f549eed361d85f715caa4f8f6436 (patch)
treed058a307946c8bf5445f4d0cb8ac31a8819329c4 /bin
parent34401cf0c3ee019fd6b8fb739e2a511c6de0870c (diff)
parent28d61f0d7f1569e643fd79fa9c31c21c2e6ec4e4 (diff)
downloadspack-c65fd3a28968f549eed361d85f715caa4f8f6436.tar.gz
spack-c65fd3a28968f549eed361d85f715caa4f8f6436.tar.bz2
spack-c65fd3a28968f549eed361d85f715caa4f8f6436.tar.xz
spack-c65fd3a28968f549eed361d85f715caa4f8f6436.zip
Merge branch 'develop' into mplegendre-multi_pkgsrc_roots
Conflicts: lib/spack/spack/cmd/create.py lib/spack/spack/cmd/extensions.py lib/spack/spack/cmd/fetch.py lib/spack/spack/cmd/uninstall.py lib/spack/spack/config.py lib/spack/spack/database.py lib/spack/spack/directory_layout.py lib/spack/spack/packages.py lib/spack/spack/spec.py
Diffstat (limited to 'bin')
-rwxr-xr-xbin/spack26
-rwxr-xr-xbin/spack-python2
2 files changed, 25 insertions, 3 deletions
diff --git a/bin/spack b/bin/spack
index 18fd1f0f34..a84cd36da1 100755
--- a/bin/spack
+++ b/bin/spack
@@ -7,7 +7,7 @@
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
-# For details, see https://scalability-llnl.github.io/spack
+# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
@@ -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:
@@ -72,6 +89,8 @@ spec expressions:
parser.add_argument('-d', '--debug', action='store_true',
help="Write out debug logs during compile")
+parser.add_argument('-D', '--pdb', action='store_true',
+ help="Run spack under the pdb debugger")
parser.add_argument('-k', '--insecure', action='store_true',
help="Do not check ssl certificates when downloading.")
parser.add_argument('-m', '--mock', action='store_true',
@@ -131,7 +150,7 @@ def main():
sys.stderr.write('\n')
tty.die("Keyboard interrupt.")
- # Allow commands to return values if they want to exit with some ohter code.
+ # Allow commands to return values if they want to exit with some other code.
if return_val is None:
sys.exit(0)
elif isinstance(return_val, int):
@@ -142,5 +161,8 @@ def main():
if args.profile:
import cProfile
cProfile.run('main()', sort='tottime')
+elif args.pdb:
+ import pdb
+ pdb.run('main()')
else:
main()
diff --git a/bin/spack-python b/bin/spack-python
index 8a4b9c175d..e0745e8c58 100755
--- a/bin/spack-python
+++ b/bin/spack-python
@@ -7,7 +7,7 @@
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
-# For details, see https://scalability-llnl.github.io/spack
+# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify