diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index cab0ad21ea..510e9c234d 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -609,7 +609,9 @@ def get_specs(force=False): tty.warn("No Spack mirrors are currently configured") return {} - path = str(spack.architecture.sys_type()) + arch = spack.architecture.sys_type() + arch_spec = 'platform=%s os=%s target=:%s' % tuple(arch.split('-')) + urls = set() for mirror_name, mirror_url in mirrors.items(): if mirror_url.startswith('file'): @@ -626,7 +628,7 @@ def get_specs(force=False): tty.msg("Finding buildcaches on %s" % mirror_url) p, links = spider(mirror_url + "/" + _build_cache_relative_path) for link in links: - if re.search("spec.yaml", link) and re.search(path, link): + if re.search("spec.yaml", link): urls.add(link) _cached_specs = [] @@ -645,7 +647,8 @@ def get_specs(force=False): # we need to mark this spec concrete on read-in. spec = Spec.from_yaml(f) spec._mark_concrete() - _cached_specs.append(spec) + if spec.satisfies(arch_spec): + _cached_specs.append(spec) return _cached_specs