示例#1
0
文件: main.py 项目: FNALssi/spack
def setup_main_options(args):
    """Configure spack globals based on the basic options."""
    # Set up environment based on args.
    tty.set_verbose(args.verbose)
    tty.set_debug(args.debug)
    tty.set_stacktrace(args.stacktrace)

    # debug must be set first so that it can even affect behvaior of
    # errors raised by spack.config.
    if args.debug:
        spack.error.debug = True
        spack.util.debug.register_interrupt_handler()
        spack.config.set('config:debug', True, scope='command_line')

    if args.timestamp:
        tty.set_timestamp(True)

    # override lock configuration if passed on command line
    if args.locks is not None:
        spack.util.lock.check_lock_safety(spack.paths.prefix)
        spack.config.set('config:locks', False, scope='command_line')

    if args.mock:
        rp = spack.repo.RepoPath(spack.paths.mock_packages_path)
        spack.repo.set_path(rp)

    # If the user asked for it, don't check ssl certs.
    if args.insecure:
        tty.warn("You asked for --insecure. Will NOT check SSL certificates.")
        spack.config.set('config:verify_ssl', False, scope='command_line')

    # when to use color (takes always, auto, or never)
    color.set_color_when(args.color)
示例#2
0
文件: main.py 项目: matzke1/spack
def setup_main_options(args):
    """Configure spack globals based on the basic options."""
    # Set up environment based on args.
    tty.set_verbose(args.verbose)
    tty.set_debug(args.debug)
    tty.set_stacktrace(args.stacktrace)

    # debug must be set first so that it can even affect behvaior of
    # errors raised by spack.config.
    if args.debug:
        spack.error.debug = True
        spack.util.debug.register_interrupt_handler()
        spack.config.set('config:debug', True, scope='command_line')

    # override lock configuration if passed on command line
    if args.locks is not None:
        spack.util.lock.check_lock_safety(spack.paths.prefix)
        spack.config.set('config:locks', False, scope='command_line')

    if args.mock:
        rp = spack.repo.RepoPath(spack.paths.mock_packages_path)
        spack.repo.set_path(rp)

    # If the user asked for it, don't check ssl certs.
    if args.insecure:
        tty.warn("You asked for --insecure. Will NOT check SSL certificates.")
        spack.config.set('config:verify_ssl', False, scope='command_line')

    # when to use color (takes always, auto, or never)
    tty.color.set_color_when(args.color)
示例#3
0
def setup_main_options(args):
    """Configure spack globals based on the basic options."""
    # Assign a custom function to show warnings
    warnings.showwarning = send_warning_to_tty

    # Set up environment based on args.
    tty.set_verbose(args.verbose)
    tty.set_debug(args.debug)
    tty.set_stacktrace(args.stacktrace)

    # debug must be set first so that it can even affect behavior of
    # errors raised by spack.config.

    if args.debug:
        spack.error.debug = True
        spack.util.debug.register_interrupt_handler()
        spack.config.set('config:debug', True, scope='command_line')
        spack.util.environment.tracing_enabled = True

    if args.show_cores != "off":
        # minimize_cores defaults to true, turn it off if we're showing full core
        # but don't want to wait to minimize it.
        spack.solver.asp.full_cores = True
        if args.show_cores == 'full':
            spack.solver.asp.minimize_cores = False

    if args.timestamp:
        tty.set_timestamp(True)

    # override lock configuration if passed on command line
    if args.locks is not None:
        if args.locks is False:
            spack.util.lock.check_lock_safety(spack.paths.prefix)
        spack.config.set('config:locks', args.locks, scope='command_line')

    if args.mock:
        rp = spack.repo.RepoPath(spack.paths.mock_packages_path)
        spack.repo.set_path(rp)

    # If the user asked for it, don't check ssl certs.
    if args.insecure:
        tty.warn("You asked for --insecure. Will NOT check SSL certificates.")
        spack.config.set('config:verify_ssl', False, scope='command_line')

    # Use the spack config command to handle parsing the config strings
    for config_var in (args.config_vars or []):
        spack.config.add(fullpath=config_var, scope="command_line")

    # when to use color (takes always, auto, or never)
    color.set_color_when(args.color)
示例#4
0
def setup_main_options(args):
    """Configure spack globals based on the basic options."""
    # Set up environment based on args.
    tty.set_verbose(args.verbose)
    tty.set_debug(args.debug)
    tty.set_stacktrace(args.stacktrace)
    spack.debug = args.debug

    if spack.debug:
        import spack.util.debug as debug
        debug.register_interrupt_handler()

    if args.mock:
        from spack.repository import RepoPath
        spack.repo.swap(RepoPath(spack.mock_packages_path))

    # If the user asked for it, don't check ssl certs.
    if args.insecure:
        tty.warn("You asked for --insecure. Will NOT check SSL certificates.")
        spack.insecure = True