all_urls: add urls[0] for versions (#16435)

This adds the `url` alternative `urls` to `package.all_urls`. With
this addition, one can find again new versions with
`spack versions <package>` for packages that are populated with
from mixin mirror `urls`.

Example: `util-macros` from x.org mixin.
This commit is contained in:
Axel Huebl 2020-05-08 01:12:45 -07:00 committed by GitHub
parent 4ebff5cef9
commit f5844d3d81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2011,6 +2011,10 @@ def all_urls(self):
if hasattr(self, 'url') and self.url:
urls.append(self.url)
# fetch from first entry in urls to save time
if hasattr(self, 'urls') and self.urls:
urls.append(self.urls[0])
for args in self.versions.values():
if 'url' in args:
urls.append(args['url'])