예제 #1
0
파일: stage.py 프로젝트: dshrader/spack
def _get_mirrors():
    """Get mirrors from spack configuration."""
    config = spack.config.get_config()

    mirrors = []
    sec_names = config.get_section_names('mirror')
    for name in sec_names:
        mirrors.append(config.get_value('mirror', name, 'url'))
    return mirrors
예제 #2
0
파일: stage.py 프로젝트: fgeorgatos/spack
def _get_mirrors():
    """Get mirrors from spack configuration."""
    config = spack.config.get_config()

    mirrors = []
    sec_names = config.get_section_names('mirror')
    for name in sec_names:
        mirrors.append(config.get_value('mirror', name, 'url'))
    return mirrors
예제 #3
0
파일: mirror.py 프로젝트: scrobey/spack
def mirror_list(args):
    """Print out available mirrors to the console."""
    config = spack.config.get_config()
    sec_names = config.get_section_names('mirror')

    if not sec_names:
        tty.msg("No mirrors configured.")
        return

    max_len = max(len(s) for s in sec_names)
    fmt = "%%-%ds%%s" % (max_len + 4)

    for name in sec_names:
        val = config.get_value('mirror', name, 'url')
        print fmt % (name, val)
예제 #4
0
파일: mirror.py 프로젝트: wnissen/spack
def mirror_list(args):
    """Print out available mirrors to the console."""
    config = spack.config.get_config()
    sec_names = config.get_section_names('mirror')

    if not sec_names:
        tty.msg("No mirrors configured.")
        return

    max_len = max(len(s) for s in sec_names)
    fmt = "%%-%ds%%s" % (max_len + 4)

    for name in sec_names:
        val = config.get_value('mirror', name, 'url')
        print fmt % (name, val)
예제 #5
0
def _get_config():
    """Get a Spack config, but make sure it has compiler configuration
       first."""
    # If any configuration file has compilers, just stick with the
    # ones already configured.
    config = spack.config.get_config()
    existing = [spack.spec.CompilerSpec(s)
                for s in config.get_section_names('compiler')]
    if existing:
        return config

    compilers = find_compilers(*get_path('PATH'))
    new_compilers = [
        c for c in compilers if c.spec not in existing]
    add_compilers_to_config('user', *new_compilers)

    # After writing compilers to the user config, return a full config
    # from all files.
    return spack.config.get_config(refresh=True)
예제 #6
0
def _get_config():
    """Get a Spack config, but make sure it has compiler configuration
       first."""
    # If any configuration file has compilers, just stick with the
    # ones already configured.
    config = spack.config.get_config()
    existing = [
        spack.spec.CompilerSpec(s)
        for s in config.get_section_names('compiler')
    ]
    if existing:
        return config

    compilers = find_compilers(*get_path('PATH'))
    new_compilers = [c for c in compilers if c.spec not in existing]
    add_compilers_to_config('user', *new_compilers)

    # After writing compilers to the user config, return a full config
    # from all files.
    return spack.config.get_config(refresh=True)