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.
This commit is contained in:
parent
4181fd79cd
commit
4f09e8c975
@ -37,7 +37,7 @@
|
||||
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,6 +308,7 @@ def fetch(self, mirror_only=False):
|
||||
archive_version = spack.url.parse_version(self.default_fetcher.url)
|
||||
package_name = os.path.dirname(self.mirror_path)
|
||||
pkg = spack.repo.get(package_name)
|
||||
if pkg.list_url is not None:
|
||||
versions = pkg.fetch_remote_versions()
|
||||
try:
|
||||
url_from_list = versions[Version(archive_version)]
|
||||
|
Loading…
Reference in New Issue
Block a user