summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGlenn Johnson <glenn-johnson@uiowa.edu>2016-07-23 22:56:08 -0500
committerGlenn Johnson <glenn-johnson@uiowa.edu>2016-07-23 22:56:08 -0500
commit4f09e8c9759473257ca8857bfa09eeeeca08cafd (patch)
tree0652f2da3b20b2d8c6f8a6995224908938290925 /lib
parent4181fd79cd6993ccb5cb95c4d3dd8d2cdf0b17c3 (diff)
downloadspack-4f09e8c9759473257ca8857bfa09eeeeca08cafd.tar.gz
spack-4f09e8c9759473257ca8857bfa09eeeeca08cafd.tar.bz2
spack-4f09e8c9759473257ca8857bfa09eeeeca08cafd.tar.xz
spack-4f09e8c9759473257ca8857bfa09eeeeca08cafd.zip
Only use list if list_url set
This commit will make urls from list_url only checked if `list_url` is set in the package file. This makes more sense as there is no need to check for those if the attribute is not present. If `url` is present and `list_url` is not then it would result in the same url. If `url_for_version` is used then that will not work anyway.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/stage.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index cf1c9d7b50..6cf736b3f0 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -37,7 +37,7 @@ import spack
import spack.config
import spack.fetch_strategy as fs
import spack.error
-from spack.version import Version
+from spack.version import *
STAGE_PREFIX = 'spack-stage-'
@@ -308,13 +308,14 @@ class Stage(object):
archive_version = spack.url.parse_version(self.default_fetcher.url)
package_name = os.path.dirname(self.mirror_path)
pkg = spack.repo.get(package_name)
- 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)
+ if pkg.list_url is not None:
+ 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)
for fetcher in fetchers:
try: