Exemple #1
0
def export_one(path, enable=True):
    """Enables (default) or disables repository export at a given
    `path`, based on `enable` value.
    """
    if enable:
        log.debug("Allow {0!r}".format(path))
        open(export_path(path), "a").close()
    else:
        log.debug("Deny {0!r}".format(path))
        util.unlink(export_path(path))
Exemple #2
0
def symlink_config(git_dir): #pragma: no cover
    """
    Place a symlink for the gitosis.conf file in the homedir of the gitosis
    user, to make possible to find initially.
    """
    dst = os.path.expanduser('~/.gitosis.conf')
    tmp = '%s.%d.tmp' % (dst, os.getpid())
    util.unlink(tmp)
    os.symlink(
        os.path.join(git_dir, 'gitosis.conf'),
        tmp,
        )
    os.rename(tmp, dst)