예제 #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 프로젝트: LLNL/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)
    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 pymod globals based on the basic options."""
    # Set up environment based on args.
    tty.set_verbose(args.verbose)
    tty.set_debug(args.debug)
    #    tty.set_trace(args.trace)

    # debug must be set first so that it can even affect behavior of
    # errors raised by pymod.config.
    if args.debug:
        # pymod.error.debug = True
        pymod.config.set("debug", True, scope="command_line")

    if args.dryrun:
        pymod.config.set("dryrun", True, scope="command_line")

    if args.shell != pymod.config.get("default_shell"):
        pymod.shell.set_shell(args.shell)

    # when to use color (takes always, auto, or never)
    color.set_color_when(args.color)