def test_smoke_the_default_config(self):
     # Make sure we can parse, interpret and plan based on the default
     # config file.
     root = get_launchpad_root()
     config_filename = os.path.join(root, 'utilities', 'sourcedeps.conf')
     config_file = open(config_filename)
     config = interpret_config(parse_config_file(config_file), False)
     config_file.close()
     plan_update([], config)
예제 #2
0
def main(args):
    parser = optparse.OptionParser("usage: %prog [options] [root [conffile]]")
    parser.add_option(
        '--public-only', action='store_true',
        help='Only fetch/update the public sourcecode branches.')
    parser.add_option(
        '--tip', action='store_true',
        help='Ignore revision constraints for all branches and pull tip')
    parser.add_option(
        '--dry-run', action='store_true',
        help='Do nothing, but report what would have been done.')
    parser.add_option(
        '--quiet', action='store_true',
        help="Don't print informational messages.")
    parser.add_option(
        '--use-http', action='store_true',
        help="Force bzr to use http to get the sourcecode branches "
             "rather than using bzr+ssh.")
    options, args = parser.parse_args(args)
    root = get_launchpad_root()
    if len(args) > 1:
        sourcecode_directory = args[1]
    else:
        sourcecode_directory = os.path.join(root, 'sourcecode')
    if len(args) > 2:
        config_filename = args[2]
    else:
        config_filename = os.path.join(root, 'utilities', 'sourcedeps.conf')
    cache_filename = os.path.join(
        root, 'utilities', 'sourcedeps.cache')
    if len(args) > 3:
        parser.error("Too many arguments.")
    if not options.quiet:
        print 'Sourcecode: %s' % (sourcecode_directory,)
        print 'Config: %s' % (config_filename,)
    enable_default_logging()
    # Tell bzr to use the terminal (if any) to show progress bars
    ui.ui_factory = ui.make_ui_for_terminal(
        sys.stdin, sys.stdout, sys.stderr)
    load_plugins()
    update_sourcecode(
        sourcecode_directory, config_filename, cache_filename,
        options.public_only, options.tip, options.dry_run, options.quiet,
        options.use_http)
    return 0
예제 #3
0
def main(args):
    parser = optparse.OptionParser("usage: %prog [options] [root [conffile]]")
    parser.add_option('--public-only',
                      action='store_true',
                      help='Only fetch/update the public sourcecode branches.')
    parser.add_option(
        '--tip',
        action='store_true',
        help='Ignore revision constraints for all branches and pull tip')
    parser.add_option('--dry-run',
                      action='store_true',
                      help='Do nothing, but report what would have been done.')
    parser.add_option('--quiet',
                      action='store_true',
                      help="Don't print informational messages.")
    parser.add_option(
        '--use-http',
        action='store_true',
        help="Force bzr to use http to get the sourcecode branches "
        "rather than using bzr+ssh.")
    options, args = parser.parse_args(args)
    root = get_launchpad_root()
    if len(args) > 1:
        sourcecode_directory = args[1]
    else:
        sourcecode_directory = os.path.join(root, 'sourcecode')
    if len(args) > 2:
        config_filename = args[2]
    else:
        config_filename = os.path.join(root, 'utilities', 'sourcedeps.conf')
    cache_filename = os.path.join(root, 'utilities', 'sourcedeps.cache')
    if len(args) > 3:
        parser.error("Too many arguments.")
    if not options.quiet:
        print 'Sourcecode: %s' % (sourcecode_directory, )
        print 'Config: %s' % (config_filename, )
    enable_default_logging()
    # Tell bzr to use the terminal (if any) to show progress bars
    ui.ui_factory = ui.make_ui_for_terminal(sys.stdin, sys.stdout, sys.stderr)
    load_plugins()
    update_sourcecode(sourcecode_directory, config_filename, cache_filename,
                      options.public_only, options.tip, options.dry_run,
                      options.quiet, options.use_http)
    return 0