def get_specs(force=False, allarch=False):
    "\n    Get spec.yaml's for build caches available on mirror\n    "
    arch = architecture.Arch(architecture.platform(), 'default_os', 'default_target')
    arch_pattern = '([^-]*-[^-]*-[^-]*)'
    if (not allarch):
        arch_pattern = ('(%s-%s-[^-]*)' % (arch.platform, arch.os))
    regex_pattern = ('%s(.*)(spec.yaml$)' % arch_pattern)
    arch_re = re.compile(regex_pattern)
    if (not spack.mirror.MirrorCollection()):
        tty.debug('No Spack mirrors are currently configured')
        return {}
    urls = set()
    for mirror in spack.mirror.MirrorCollection().values():
        fetch_url_build_cache = url_util.join(mirror.fetch_url, _build_cache_relative_path)
        mirror_dir = url_util.local_file_path(fetch_url_build_cache)
        if mirror_dir:
            tty.msg(('Finding buildcaches in %s' % mirror_dir))
            if os.path.exists(mirror_dir):
                files = os.listdir(mirror_dir)
                for file in files:
                    m = arch_re.search(file)
                    if m:
                        link = url_util.join(fetch_url_build_cache, file)
                        urls.add(link)
        else:
            tty.msg(('Finding buildcaches at %s' % url_util.format(fetch_url_build_cache)))
            (p, links) = web_util.spider(url_util.join(fetch_url_build_cache, 'index.html'))
            for link in links:
                m = arch_re.search(link)
                if m:
                    urls.add(link)
    return try_download_specs(urls=urls, force=force)
Get spec.yaml's for build caches available on mirror
def get_specs(force=False, allarch=False):
    "\n    \n    "
    arch = architecture.Arch(architecture.platform(), 'default_os', 'default_target')
    arch_pattern = '([^-]*-[^-]*-[^-]*)'
    if (not allarch):
        arch_pattern = ('(%s-%s-[^-]*)' % (arch.platform, arch.os))
    regex_pattern = ('%s(.*)(spec.yaml$)' % arch_pattern)
    arch_re = re.compile(regex_pattern)
    if (not spack.mirror.MirrorCollection()):
        tty.debug('No Spack mirrors are currently configured')
        return {}
    urls = set()
    for mirror in spack.mirror.MirrorCollection().values():
        fetch_url_build_cache = url_util.join(mirror.fetch_url, _build_cache_relative_path)
        mirror_dir = url_util.local_file_path(fetch_url_build_cache)
        if mirror_dir:
            tty.msg(('Finding buildcaches in %s' % mirror_dir))
            if os.path.exists(mirror_dir):
                files = os.listdir(mirror_dir)
                for file in files:
                    m = arch_re.search(file)
                    if m:
                        link = url_util.join(fetch_url_build_cache, file)
                        urls.add(link)
        else:
            tty.msg(('Finding buildcaches at %s' % url_util.format(fetch_url_build_cache)))
            (p, links) = web_util.spider(url_util.join(fetch_url_build_cache, 'index.html'))
            for link in links:
                m = arch_re.search(link)
                if m:
                    urls.add(link)
    return try_download_specs(urls=urls, force=force)