summaryrefslogtreecommitdiff
path: root/lib/spack/spack/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/package.py')
-rw-r--r--lib/spack/spack/package.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index cb4a6e1ac3..d3a716f552 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -2063,8 +2063,15 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)):
@property
def all_urls(self):
+ """A list of all URLs in a package.
+
+ Check both class-level and version-specific URLs.
+
+ Returns:
+ list: a list of URLs
+ """
urls = []
- if self.url:
+ if hasattr(self, 'url') and self.url:
urls.append(self.url)
for args in self.versions.values():
@@ -2073,10 +2080,15 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)):
return urls
def fetch_remote_versions(self):
- """Try to find remote versions of this package using the
- list_url and any other URLs described in the package file."""
+ """Find remote versions of this package.
+
+ Uses ``list_url`` and any other URLs listed in the package file.
+
+ Returns:
+ dict: a dictionary mapping versions to URLs
+ """
if not self.all_urls:
- raise spack.util.web.VersionFetchError(self.__class__)
+ return {}
try:
return spack.util.web.find_versions_of_archive(