'Syncs the current repo configuration file with the filesystem.'

def run(self, name=None, verbose=True):

    self.logger.info('run,    reposync,    run!')
    try:
        self.tries = int(self.tries)
    except:
        utils.die(self.logger, 'retry    value    must    be    an    integer')
    self.verbose = verbose
    report_failure = False
    for repo in self.repos:
        if ((name is not None) and (repo.name != name)):
            continue
        elif ((name is None) and (not repo.keep_updated)):
            self.logger.info(('%s    is    set    to    not    be    updated' % repo.name))
            continue
        repo_mirror = os.path.join(self.settings.webdir, 'repo_mirror')
        repo_path = os.path.join(repo_mirror, repo.name)
        if ((not os.path.isdir(repo_path)) and (not repo.mirror.lower().startswith('rhn://'))):
            os.makedirs(repo_path)
        env = repo.environment
        old_env = {}
        for k in env.keys():
            self.logger.debug(('setting    repo    environment:    %s=%s' % (k, env[k])))
            if (env[k] is not None):
                if os.getenv(k):
                    old_env[k] = os.getenv(k)
                else:
                    os.environ[k] = env[k]
        for x in range((self.tries + 1), 1, (-1)):
            success = False
            try:
                self.sync(repo)
                success = True
                break
            except:
                utils.log_exc(self.logger)
                self.logger.warning(('reposync    failed,    tries    left:    %s' % (x - 2)))
        for k in env.keys():
            if (env[k] is not None):
                if (k in old_env):
                    self.logger.debug(('resetting    repo    environment:    %s=%s' % (k, old_env[k])))
                    os.environ[k] = old_env[k]
                else:
                    self.logger.debug(('removing    repo    environment:    %s=%s' % (k, env[k])))
                    del os.environ[k]
        if (not success):
            report_failure = True
            if (not self.nofail):
                utils.die(self.logger, 'reposync    failed,    retry    limit    reached,    aborting')
            else:
                self.logger.error('reposync    failed,    retry    limit    reached,    skipping')
        self.update_permissions(repo_path)
    if report_failure:
        utils.die(self.logger, 'overall    reposync    failed,    at    least    one    repo    failed    to    synchronize')
