diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2016-04-27 15:00:47 -0400 |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2016-06-29 14:49:19 -0400 |
commit | 6f69c01915aad8bb2d4b242ab7e5b185adf08b7d (patch) | |
tree | 84d3a4f447ca930d09a11d8fadabaafa9431df76 | |
parent | eb388306fde0f636e595b5ac5eae37a3c5850f4b (diff) | |
download | spack-6f69c01915aad8bb2d4b242ab7e5b185adf08b7d.tar.gz spack-6f69c01915aad8bb2d4b242ab7e5b185adf08b7d.tar.bz2 spack-6f69c01915aad8bb2d4b242ab7e5b185adf08b7d.tar.xz spack-6f69c01915aad8bb2d4b242ab7e5b185adf08b7d.zip |
bootstrap: fall back to the default upstream URL
Fixes #352.
-rw-r--r-- | lib/spack/spack/cmd/bootstrap.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/bootstrap.py b/lib/spack/spack/cmd/bootstrap.py index bec11439b5..9fd428e6b1 100644 --- a/lib/spack/spack/cmd/bootstrap.py +++ b/lib/spack/spack/cmd/bootstrap.py @@ -31,6 +31,8 @@ from llnl.util.filesystem import join_path, mkdirp import spack from spack.util.executable import which +_SPACK_UPSTREAM = 'https://github.com/llnl/spack' + description = "Create a new installation of spack in another prefix" def setup_parser(subparser): @@ -40,9 +42,15 @@ def setup_parser(subparser): def get_origin_url(): git_dir = join_path(spack.prefix, '.git') git = which('git', required=True) - origin_url = git( - '--git-dir=%s' % git_dir, 'config', '--get', 'remote.origin.url', - output=str) + try: + origin_url = git( + '--git-dir=%s' % git_dir, + 'config', '--get', 'remote.origin.url', + output=str) + except ProcessError: + origin_url = _SPACK_UPSTREAM + tty.warn('No git repository found; ' + 'using default upstream URL: %s' % origin_url) return origin_url.strip() |