Skip to content

Commit

Permalink
Merge branch 'develop' for v0.8.15
Browse files Browse the repository at this point in the history
  • Loading branch information
tgamblin committed Feb 24, 2015
2 parents fa21acc + ffdb90f commit 8eab69f
Show file tree
Hide file tree
Showing 199 changed files with 9,488 additions and 1,647 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,19 @@ Authors
----------------
Spack was written by Todd Gamblin, tgamblin@llnl.gov.

Significant contributions were also made by the following awesome
people:
Significant contributions were also made by:

* David Beckingsale
* David Boehme
* Alfredo Gimenez
* Luc Jaulmes
* Matt Legendre
* Greg Lee
* Adam Moody
* Saravan Pantham
* Joachim Protze
* Bob Robey
* Justin Too

Release
----------------
Expand Down
79 changes: 49 additions & 30 deletions bin/spack
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
##############################################################################
import sys
if not sys.version_info[:2] >= (2,6):
sys.exit("Spack requires Python 2.6. Version was %s." % sys.version_info)
v_info = sys.version_info[:3]
sys.exit("Spack requires Python 2.6 or higher. This is Python %d.%d.%d." % v_info)

import os

Expand Down Expand Up @@ -57,14 +58,16 @@ parser = argparse.ArgumentParser(
description='Spack: the Supercomputing PACKage Manager.')
parser.add_argument('-V', '--version', action='version',
version="%s" % spack.spack_version)
parser.add_argument('-v', '--verbose', action='store_true', dest='verbose',
parser.add_argument('-v', '--verbose', action='store_true',
help="Print additional output during builds")
parser.add_argument('-d', '--debug', action='store_true', dest='debug',
parser.add_argument('-d', '--debug', action='store_true',
help="Write out debug logs during compile")
parser.add_argument('-k', '--insecure', action='store_true', dest='insecure',
parser.add_argument('-k', '--insecure', action='store_true',
help="Do not check ssl certificates when downloading archives.")
parser.add_argument('-m', '--mock', action='store_true', dest='mock',
parser.add_argument('-m', '--mock', action='store_true',
help="Use mock packages instead of real ones.")
parser.add_argument('-p', '--profile', action='store_true',
help="Profile execution using cProfile.")

# each command module implements a parser() function, to which we pass its
# subparser for setup.
Expand All @@ -84,33 +87,49 @@ if len(sys.argv) == 1:
# actually parse the args.
args = parser.parse_args()

# Set up environment based on args.
tty.set_verbose(args.verbose)
tty.set_debug(args.debug)
spack.debug = args.debug
def main():
# Set up environment based on args.
tty.set_verbose(args.verbose)
tty.set_debug(args.debug)
spack.debug = args.debug

spack.spack_working_dir = working_dir
if args.mock:
from spack.packages import PackageDB
spack.db = PackageDB(spack.mock_packages_path)
spack.spack_working_dir = working_dir
if args.mock:
from spack.packages import PackageDB
spack.db = PackageDB(spack.mock_packages_path)

# If the user asked for it, don't check ssl certs.
if args.insecure:
tty.warn("You asked for --insecure, which does not check SSL certificates or checksums.")
spack.curl.add_default_arg('-k')
# If the user asked for it, don't check ssl certs.
if args.insecure:
tty.warn("You asked for --insecure, which does not check SSL certificates or checksums.")
spack.curl.add_default_arg('-k')

# Try to load the particular command asked for and run it
command = spack.cmd.get_command(args.command)
try:
command(parser, args)
except SpackError, e:
if spack.debug:
# In debug mode, raise with a full stack trace.
raise
elif e.long_message:
tty.die(e.message, e.long_message)
# Try to load the particular command asked for and run it
command = spack.cmd.get_command(args.command)
try:
return_val = command(parser, args)
except SpackError, e:
if spack.debug:
# In debug mode, raise with a full stack trace.
raise
elif e.long_message:
tty.die(e.message, e.long_message)
else:
tty.die(e.message)

except KeyboardInterrupt:
sys.stderr.write('\n')
tty.die("Keyboard interrupt.")

# Allow commands to return values if they want to exit with some ohter code.
if return_val is None:
sys.exit(0)
elif isinstance(return_val, int):
sys.exit(return_val)
else:
tty.die(e.message)
tty.die("Bad return value from command %s: %s" % (args.command, return_val))

except KeyboardInterrupt:
tty.die("Keyboard interrupt.")
if args.profile:
import cProfile
cProfile.run('main()', sort='tottime')
else:
main()
1 change: 1 addition & 0 deletions lib/spack/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package_list.rst
command_index.rst
spack*.rst
_build
18 changes: 15 additions & 3 deletions lib/spack/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ all: html
# This autogenerates a package list.
#
package_list:
spack info -r > package_list.rst
spack package-list > package_list.rst

#
# Generate a command index
#
command_index:
cp command_index.in command_index.rst
echo >> command_index.rst
grep -ho '.. _spack-.*:' *rst \
| perl -pe 's/.. _([^:]*):/ * :ref:`\1`/' \
| sort >> command_index.rst

custom_targets: package_list command_index

#
# This creates a git repository and commits generated html docs.
Expand Down Expand Up @@ -77,10 +89,10 @@ help:
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
-rm -f package_list.rst
-rm -f package_list.rst command_index.rst
-rm -rf $(BUILDDIR)/* $(APIDOC_FILES)

html: apidoc package_list
html: apidoc custom_targets
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
Expand Down
Loading

0 comments on commit 8eab69f

Please sign in to comment.