sudo apt-get install etckeeper mercurial
Esto instala el etckeeper y el mercurial pero no corre un init porque no encuentra el bzr (salvo que esté instalado).
Hay que editar el archivo /etc/etckeeper/etckeeper.conf y comentar todas las líneas (del principio) que dicen:
VCS=...
y descomentar únicamente la que dice:
VCS="hg"
Además, agregar en la línea que comienza con HG_COMMIT_OPTIONS lo siguiente:
HG_COMMIT_OPTIONS="-u etckeeper-auto@<nombre-del-host>"
de modo tal que los commits auotmáticos tengan ese usuario.
Mi archivo /etc/etckeeper/etckeeper.conf (en ubuntu 11.04) quedó así:
# The VCS to use. VCS="hg" #VCS="git" #VCS="bzr" #VCS="darcs" # Options passed to git commit when run by etckeeper. GIT_COMMIT_OPTIONS="" # Options passed to hg commit when run by etckeeper. HG_COMMIT_OPTIONS="-u etckeeper-auto@<nombre-del-host>" # Options passed to bzr commit when run by etckeeper. BZR_COMMIT_OPTIONS="" # Options passed to darcs record when run by etckeeper. DARCS_COMMIT_OPTIONS="-a" # Uncomment to avoid etckeeper committing existing changes # to /etc automatically once per day. #AVOID_DAILY_AUTOCOMMITS=1 # Uncomment to avoid etckeeper committing existing changes to # /etc before installation. It will cancel the installation, # so you can commit the changes by hand. #AVOID_COMMIT_BEFORE_INSTALL=1 # The high-level package manager that's being used. # (apt, pacman-g2, yum etc) HIGHLEVEL_PACKAGE_MANAGER=apt # The low-level package manager that's being used. # (dpkg, rpm, pacman-g2, etc) LOWLEVEL_PACKAGE_MANAGER=dpkg
Finalmente inicializamos el repositorio y lo commiteamos:
sudo etckeeper init sudo etckeeper commit "configuración inicial"
Después del init, editar el archivo /etc/.hg/hgrc y agregarle:
[ui] username = root@<nombre-del-host> EOF
de modo tal que los commits manuales tengan ese usuario