summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGlenn Johnson <glenn-johnson@uiowa.edu>2016-08-05 11:06:07 -0500
committerGlenn Johnson <glenn-johnson@uiowa.edu>2016-08-05 11:16:43 -0500
commit20221ee3aa3003d4180c86bf43bb7156a04d08e7 (patch)
treee0466106d789103e130380a1182d46cf75ed0345 /lib
parent0c02ee86a752f4e60680ea42a6525622b57bff48 (diff)
downloadspack-20221ee3aa3003d4180c86bf43bb7156a04d08e7.tar.gz
spack-20221ee3aa3003d4180c86bf43bb7156a04d08e7.tar.bz2
spack-20221ee3aa3003d4180c86bf43bb7156a04d08e7.tar.xz
spack-20221ee3aa3003d4180c86bf43bb7156a04d08e7.zip
Catch error for version in VCS
This PR will catch the error where the url can not be determined from a VCS URL, such as git. It will print a message to the console and move on because it should not be a fatal error at this point in the process. This should fix #1459.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/stage.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index 553c4ad05f..8fcc331482 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -321,15 +321,19 @@ class Stage(object):
package_name = os.path.dirname(self.mirror_path)
pkg = spack.repo.get(package_name)
if pkg.list_url is not None and pkg.url is not None:
- archive_version = spack.url.parse_version(
- self.default_fetcher.url)
- versions = pkg.fetch_remote_versions()
try:
- url_from_list = versions[Version(archive_version)]
- fetchers.append(fs.URLFetchStrategy(url_from_list, digest))
- except KeyError:
- tty.msg("Can not find version %s in url_list" %
- archive_version)
+ archive_version = spack.url.parse_version(
+ self.default_fetcher.url)
+ versions = pkg.fetch_remote_versions()
+ try:
+ url_from_list = versions[Version(archive_version)]
+ fetchers.append(fs.URLFetchStrategy(
+ url_from_list, digest))
+ except KeyError:
+ tty.msg("Can not find version %s in url_list" %
+ archive_version)
+ except:
+ tty.msg("Could not determine url from list_url.")
for fetcher in fetchers:
try: