summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README99
-rw-r--r--debian/changelog2
-rw-r--r--debian/control13
-rw-r--r--debian/po/cs.po12
-rw-r--r--debian/po/eu.po12
-rw-r--r--debian/po/fi.po12
-rw-r--r--debian/po/fr.po12
-rw-r--r--debian/po/gl.po12
-rw-r--r--debian/po/it.po12
-rw-r--r--debian/po/nl.po12
-rw-r--r--debian/po/pt.po12
-rw-r--r--debian/po/ru.po12
-rw-r--r--debian/po/templates.pot6
-rw-r--r--debian/postinst30
-rw-r--r--debian/preinst4
-rwxr-xr-xdebian/rules2
-rw-r--r--debian/templates6
-rw-r--r--etckeeper.120
-rwxr-xr-xpre-install.d/50uncommitted-changes2
19 files changed, 166 insertions, 126 deletions
diff --git a/README b/README
index 6dbffeb..5a81d98 100644
--- a/README
+++ b/README
@@ -1,10 +1,10 @@
-etckeeper is a collection of tools to let /etc be stored in a git
-repository. It hooks into apt to automatically commit changes made to /etc
-during package upgrades. It uses [metastore][1] to track file metadata
-that git does not normally support, but that is important for /etc, such as
-the permissions of `/etc/shadow`. It's quite modular and configurable,
-while also being simple to use if you understand the basics of working with
-git.
+etckeeper is a collection of tools to let /etc be stored in a git or
+mercurial repository. It hooks into apt to automatically commit changes
+made to /etc during package upgrades. It uses [metastore][1] to track file
+metadata that git does not normally support, but that is important for
+/etc, such as the permissions of `/etc/shadow`. It's quite modular and
+configurable, while also being simple to use if you understand the basics
+of working with version control.
[1]: http://david.hardeman.nu/software.php
@@ -19,14 +19,16 @@ to read their contents. However, you *also* must take care when cloning
or copying these repositories, not to allow anyone else to see the data.
Since git mushes all the files into packs under the .git directory, the
-whole .git directory content needs to be kept secret. Also, since git
-doesn't keep track of the mode of files like the shadow file, it will check
-it out world readable, before etckeeper fixes the permissions. The tutorial
-has some examples of safe ways to avoid these problems when cloning an /etc
-repository.
+whole .git directory content needs to be kept secret. (Ditto for mercurial
+and .hg)
-Also note that `etckeeper init` runs code stored in the git repository.
-So don't use it on git repositories from untrusted sources.
+Also, since revision control systems don't keep track of the mode of files
+like the shadow file, it will check out world readable, before etckeeper
+fixes the permissions. The tutorial has some examples of safe ways to avoid
+these problems when cloning an /etc repository.
+
+Also note that `etckeeper init` runs code stored in the repository.
+So don't use it on repositories from untrusted sources.
## what etckeeper does
@@ -37,43 +39,51 @@ installing and upgrading packages. Before apt installs packages,
After apt installs packages, `etckeeper post-install` will add any new
interesting files to the repository, and commit the changes.
-git is designed as a way to manage source code, not as a way to manage
-arbitrary directories like /etc. This means it has a few limitations that
-etckeeper has to work around. These include file metadata storage,
-empty directories, and special files.
+Revsion control systems are designed as a way to manage source code, not as
+a way to manage arbitrary directories like /etc. This means there are a few
+limitations that etckeeper has to work around. These include file metadata
+storage, empty directories, and special files.
-git has only limited tracking of file metadata, being able to track the
-executable bit, but not other permissions or owner info. So file metadata
-storage is handled by `metastore`. Amoung other chores, `etckeeper init`
-sets up a `pre-commit` hook that uses `metastore` to store metadata about
-file owners, permissions, and even extended attributes into a
-`/etc/.metadata` file. This metadata is stored in git along with everything
-else, and can be applied if the repo should need to be checked back out.
+git and mercurial have only limited tracking of file metadata, being able
+to track the executable bit, but not other permissions or owner info. So
+file metadata storage is handled by `metastore`. Amoung other chores,
+`etckeeper init` sets up a `pre-commit` hook that uses `metastore` to store
+metadata about file owners, permissions, and even extended attributes into
+a `/etc/.metadata` file. This metadata is stored in git along with
+everything else, and can be applied if the repo should need to be checked
+back out.
-git cannot track empty directories, but they can be significant sometimes
-in /etc. So the `pre-commit` hook also stores information that can be used
-to recreate the empty directories in a `/etc/.etckeeper` file.
+git and mercurial cannot track empty directories, but they can be
+significant sometimes in /etc. So the `pre-commit` hook also stores
+information that can be used to recreate the empty directories in a
+`/etc/.etckeeper` file.
-git doesn't support several special files that you _probably_ won't have in
-/etc, such as unix sockets, named pipes, hardlinked files (but softlinks
-are fine), and device files. The `pre-commit` hook will warn if your /etc
-contains such special files.
+git and mercurial don't support several special files that you _probably_
+won't have in /etc, such as unix sockets, named pipes, hardlinked files
+(but softlinks are fine), and device files. The `pre-commit` hook will warn
+if your /etc contains such special files.
## tutorial
-A quick walkthrough of using etckeeper. The `etckeeper init` command
-initialises an /etc/.git/ repository. This command is careful to never
-overwrite existing files or directories in /etc. It will create a `.gitignore`
-if one doesn't already exist, sets up git hooks if they don't already exist,
-and so on. It does *not* commit any files into to git, but does `git add` all
-interesting files for an initial commit.
+A quick walkthrough of using etckeeper.
+
+First, edit `/etc/etckeeper/etckeeper.conf` to select which version control
+system to use. The default is git, and this tutorial assumes you're using
+it. Mercurial is similar.
+
+The `etckeeper init` command initialises an /etc/.git/ repository. This
+command is careful to never overwrite existing files or directories in
+/etc. It will create a `.gitignore` if one doesn't already exist, sets up
+pre-commit hooks if they don't already exist, and so on. It does *not*
+commit any files, but does `git add` all interesting files for an initial
+commit later.
etckeeper init
-Now you might want to run git status to check that it includes all
+Now you might want to run `git status` to check that it includes all
the right files, and none of the wrong files. And you can edit the
-.gitignore and so forth. Once you're ready, it's time to commit:
+`.gitignore` and so forth. Once you're ready, it's time to commit:
cd /etc
git commit -m "initial checkin"
@@ -135,6 +145,8 @@ control, the sky's the limit..
## configuration
+The main configuration file is `/etc/etckeeper/etckeeper.conf`
+
etckeeper uses `run-parts` to run the executable files in
`/etc/etckeeper/$command.d/`. You can modify these files, or add your own
custom files. Each individual file is short, simple, and does only one
@@ -152,12 +164,7 @@ which will save a lot of disk space:
Here's how to disable the automatic commits after each apt run, while still
letting it git add new files and git rm removed ones:
- chmod -x /etc/etckeeper/post-install.d/75git-commit
-
-Note that the etckeeper commands are careful to not hardcode anything about
-git. If you want to use some other revision control system, that's
-theoretically possible to accomplish by just changing the files in
-/etc/etckeeper/. If you do this, please let me know.
+ chmod -x /etc/etckeeper/post-install.d/75vcs-commit
## inspiration
diff --git a/debian/changelog b/debian/changelog
index 6ab928d..53c32c6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,8 @@ etckeeper (0.7) UNRELEASED; urgency=low
to be used for other package managers.
* Use the name of the highlevel package manager in commit messages.
* Add gnarly conffile renaming code.
+ * Support mercurial as an alternative to git. Original patch by Mathieu
+ Clabaut, significantly changed.
[ Miklos Vajna ]
* Add support for frugalware's pacman-g2 package manager.
diff --git a/debian/control b/debian/control
index 708f929..8a03771 100644
--- a/debian/control
+++ b/debian/control
@@ -10,11 +10,12 @@ Homepage: http://kitenet.net/~joey/code/etckeeper/
Package: etckeeper
Architecture: all
Section: admin
-Depends: metastore, git-core (>= 1:1.5.3.4), ${misc:Depends}
-Description: store /etc in git
- The etckeeper program is a tool to let /etc be stored in a git
+Depends: metastore, git-core (>= 1:1.5.3.4) | mercurial, ${misc:Depends}
+Description: store /etc in git or mercurial
+ The etckeeper program is a tool to let /etc be stored in a git or mercurial
repository. It hooks into APT to automatically commit changes made to /etc
during package upgrades. It uses 'metastore' to track file metadata that
- git does not normally support, but that is important for /etc, such as the
- permissions of /etc/shadow. It's quite modular and configurable, while
- also being simple to use if you understand the basics of working with git.
+ version control systems do not normally support, but that is important for
+ /etc, such as the permissions of /etc/shadow. It's quite modular and
+ configurable, while also being simple to use if you understand the basics of
+ working with version control.
diff --git a/debian/po/cs.po b/debian/po/cs.po
index 7b355b6..a9efe07 100644
--- a/debian/po/cs.po
+++ b/debian/po/cs.po
@@ -18,19 +18,19 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:2001
-msgid "Commit changed files in /etc to git?"
-msgstr "Zapsat změněné soubory v /etc do gitu?"
+msgid "Commit changed files in /etc to ${VCS}?"
+msgstr "Zapsat změněné soubory v /etc do ${VCS}?"
#. Type: boolean
#. Description
#: ../templates:2001
msgid ""
"The /etc directory contains uncommitted files or other changes. It's best "
-"for all files in /etc to be committed to git before running APT. Added and "
+"for all files in /etc to be committed to ${VCS} before running APT. Added and "
"changed files listed below can be committed automatically:"
msgstr ""
"Adresář /etc obsahuje nezapsané soubory nebo jiné změny. Před spuštěním APT "
-"je lepší mít všechny soubory v /etc uloženy do gitu. Přidané a změněné "
+"je lepší mít všechny soubory v /etc uloženy do ${VCS}. Přidané a změněné "
"soubory vypsané níže budou uloženy automaticky:"
#. Type: error
@@ -42,8 +42,8 @@ msgstr "Zápis selhal"
#. Type: error
#. Description
#: ../templates:3001
-msgid "An attempt to commit /etc changes to git failed."
-msgstr "Pokus o zapsání změn v /etc do gitu selhal."
+msgid "An attempt to commit /etc changes to ${VCS} failed."
+msgstr "Pokus o zapsání změn v /etc do ${VCS} selhal."
#. Type: error
#. Description
diff --git a/debian/po/eu.po b/debian/po/eu.po
index 372725b..86e692f 100644
--- a/debian/po/eu.po
+++ b/debian/po/eu.po
@@ -21,19 +21,19 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:2001
-msgid "Commit changed files in /etc to git?"
-msgstr "Aldaturiko fitxategiak git-en onartu?"
+msgid "Commit changed files in /etc to ${VCS}?"
+msgstr "Aldaturiko fitxategiak ${VCS}-en onartu?"
#. Type: boolean
#. Description
#: ../templates:2001
msgid ""
"The /etc directory contains uncommitted files or other changes. It's best "
-"for all files in /etc to be committed to git before running APT. Added and "
+"for all files in /etc to be committed to ${VCS} before running APT. Added and "
"changed files listed below can be committed automatically:"
msgstr ""
"/etc direktorioak onartu gabeko fitxategiak edo beste aldaketa batzuk ditu. /"
-"etc-n dauden fitxategi guztientzat hobe da git-en onarpena egitea APT "
+"etc-n dauden fitxategi guztientzat hobe da ${VCS}-en onarpena egitea APT "
"exekutatu baino lehen.Azpian dauden erantsi eta aldatutako fitxategiak "
"automatikoki onartu daitezke:"
@@ -46,8 +46,8 @@ msgstr "Onarpenak failatu du"
#. Type: error
#. Description
#: ../templates:3001
-msgid "An attempt to commit /etc changes to git failed."
-msgstr "/etc-ko aldaketak git-en onartzearen saiakerak huts egin du."
+msgid "An attempt to commit /etc changes to ${VCS} failed."
+msgstr "/etc-ko aldaketak ${VCS}-en onartzearen saiakerak huts egin du."
#. Type: error
#. Description
diff --git a/debian/po/fi.po b/debian/po/fi.po
index a8c4693..78f4766 100644
--- a/debian/po/fi.po
+++ b/debian/po/fi.po
@@ -15,19 +15,19 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:2001
-msgid "Commit changed files in /etc to git?"
-msgstr "Talletetaanko hakemiston /etc muutetut tiedostot gitiin?"
+msgid "Commit changed files in /etc to ${VCS}?"
+msgstr "Talletetaanko hakemiston /etc muutetut tiedostot ${VCS}in?"
#. Type: boolean
#. Description
#: ../templates:2001
msgid ""
"The /etc directory contains uncommitted files or other changes. It's best "
-"for all files in /etc to be committed to git before running APT. Added and "
+"for all files in /etc to be committed to ${VCS} before running APT. Added and "
"changed files listed below can be committed automatically:"
msgstr ""
"Hakemisto /etc sisältää tallettamattomia tiedostoja tai muita muutoksia. On "
-"parasta tallettaa kaikki /etc:n tiedostot git-varastoon ennen APTin "
+"parasta tallettaa kaikki /etc:n tiedostot ${VCS}-varastoon ennen APTin "
"ajamista. Alla luetellut lisätyt tai muutetut tiedostot voidaan tallettaa "
"automaattisesti."
@@ -40,8 +40,8 @@ msgstr "Tallettaminen epäonnistui"
#. Type: error
#. Description
#: ../templates:3001
-msgid "An attempt to commit /etc changes to git failed."
-msgstr "Yritys tallettaa /etc:n muutokset git-varastoon epäonnistui."
+msgid "An attempt to commit /etc changes to ${VCS} failed."
+msgstr "Yritys tallettaa /etc:n muutokset ${VCS}-varastoon epäonnistui."
#. Type: error
#. Description
diff --git a/debian/po/fr.po b/debian/po/fr.po
index d99ddc3..10f261d 100644
--- a/debian/po/fr.po
+++ b/debian/po/fr.po
@@ -21,21 +21,21 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:2001
-msgid "Commit changed files in /etc to git?"
+msgid "Commit changed files in /etc to ${VCS}?"
msgstr ""
-"Faut-il enregistrer dans git les modifications de fichiers faites dans /etc ?"
+"Faut-il enregistrer dans ${VCS} les modifications de fichiers faites dans /etc ?"
#. Type: boolean
#. Description
#: ../templates:2001
msgid ""
"The /etc directory contains uncommitted files or other changes. It's best "
-"for all files in /etc to be committed to git before running APT. Added and "
+"for all files in /etc to be committed to ${VCS} before running APT. Added and "
"changed files listed below can be committed automatically:"
msgstr ""
"Le répertoire /etc contient des fichiers non synchronisés ou d'autres "
"changements. Il est préférable que toutes les modifications apportées dans /"
-"etc soient enregistrées dans git avant de lancer APT. Les ajouts et "
+"etc soient enregistrées dans ${VCS} avant de lancer APT. Les ajouts et "
"modifications de fichiers dont la liste suit peuvent être enregistrés "
"automatiquement :"
@@ -48,9 +48,9 @@ msgstr "Échec de la synchronisation"
#. Type: error
#. Description
#: ../templates:3001
-msgid "An attempt to commit /etc changes to git failed."
+msgid "An attempt to commit /etc changes to ${VCS} failed."
msgstr ""
-"La tentative d'enregistrement des modifications de /etc vers git a échoué."
+"La tentative d'enregistrement des modifications de /etc vers ${VCS} a échoué."
#. Type: error
#. Description
diff --git a/debian/po/gl.po b/debian/po/gl.po
index ca00982..7c47c91 100644
--- a/debian/po/gl.po
+++ b/debian/po/gl.po
@@ -17,19 +17,19 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:2001
-msgid "Commit changed files in /etc to git?"
-msgstr "¿Gardar en git os ficheiros modificados de /etc?"
+msgid "Commit changed files in /etc to ${VCS}?"
+msgstr "¿Gardar en ${VCS} os ficheiros modificados de /etc?"
#. Type: boolean
#. Description
#: ../templates:2001
msgid ""
"The /etc directory contains uncommitted files or other changes. It's best "
-"for all files in /etc to be committed to git before running APT. Added and "
+"for all files in /etc to be committed to ${VCS} before running APT. Added and "
"changed files listed below can be committed automatically:"
msgstr ""
"O directorio /etc contén ficheiros ou outros cambios sen gardar. É mellor "
-"que se garden en git tódolos ficheiros de /etc antes de executar APT. Os "
+"que se garden en ${VCS} tódolos ficheiros de /etc antes de executar APT. Os "
"ficheiros engadidos e modificados da lista de embaixo pódense gardar "
"automaticamente:"
@@ -42,8 +42,8 @@ msgstr "O gardado fallou"
#. Type: error
#. Description
#: ../templates:3001
-msgid "An attempt to commit /etc changes to git failed."
-msgstr "Fallou unha tentativa de gardar en git os cambios de /etc."
+msgid "An attempt to commit /etc changes to ${VCS} failed."
+msgstr "Fallou unha tentativa de gardar en ${VCS} os cambios de /etc."
#. Type: error
#. Description
diff --git a/debian/po/it.po b/debian/po/it.po
index 2b547b4..a40b8bc 100644
--- a/debian/po/it.po
+++ b/debian/po/it.po
@@ -18,20 +18,20 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:2001
-msgid "Commit changed files in /etc to git?"
-msgstr "Commit dei file modificati in /etc a git?"
+msgid "Commit changed files in /etc to ${VCS}?"
+msgstr "Commit dei file modificati in /etc a ${VCS}?"
#. Type: boolean
#. Description
#: ../templates:2001
msgid ""
"The /etc directory contains uncommitted files or other changes. It's best "
-"for all files in /etc to be committed to git before running APT. Added and "
+"for all files in /etc to be committed to ${VCS} before running APT. Added and "
"changed files listed below can be committed automatically:"
msgstr ""
"La directory /etc contiene dei file di cui non è stato ancora fatto il "
"commit o altre modifiche. Si consiglia di effettuare il commit di tutti i "
-"file in /etc a git prima di eseguire APT. È possibile fare automaticamente "
+"file in /etc a ${VCS} prima di eseguire APT. È possibile fare automaticamente "
"il commit dei file nuovi o modificati elencati in seguito:"
#. Type: error
@@ -43,8 +43,8 @@ msgstr "Commit fallito"
#. Type: error
#. Description
#: ../templates:3001
-msgid "An attempt to commit /etc changes to git failed."
-msgstr "Il tentativo di commit delle modifiche in /etc a git è fallito."
+msgid "An attempt to commit /etc changes to ${VCS} failed."
+msgstr "Il tentativo di commit delle modifiche in /etc a ${VCS} è fallito."
#. Type: error
#. Description
diff --git a/debian/po/nl.po b/debian/po/nl.po
index dafef37..a6eac26 100644
--- a/debian/po/nl.po
+++ b/debian/po/nl.po
@@ -19,19 +19,19 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:2001
-msgid "Commit changed files in /etc to git?"
-msgstr "Wilt u aangepaste bestanden uit de map '/etc' vastleggen in git?"
+msgid "Commit changed files in /etc to ${VCS}?"
+msgstr "Wilt u aangepaste bestanden uit de map '/etc' vastleggen in ${VCS}?"
#. Type: boolean
#. Description
#: ../templates:2001
msgid ""
"The /etc directory contains uncommitted files or other changes. It's best "
-"for all files in /etc to be committed to git before running APT. Added and "
+"for all files in /etc to be committed to ${VCS} before running APT. Added and "
"changed files listed below can be committed automatically:"
msgstr ""
"De map '/etc' bevat niet-vastgelegde bestanden of andere aanpassingen. Het "
-"is sterk aan te raden om alle aanpassingen in '/etc/' vast te leggen in git "
+"is sterk aan te raden om alle aanpassingen in '/etc/' vast te leggen in ${VCS} "
"vooraleer u APT uitvoert. De hieronder aangegeven toegevoegde en veranderde "
"bestanden worden automatisch opgeslagen."
@@ -44,9 +44,9 @@ msgstr "Vastleggen is mislukt."
#. Type: error
#. Description
#: ../templates:3001
-msgid "An attempt to commit /etc changes to git failed."
+msgid "An attempt to commit /etc changes to ${VCS} failed."
msgstr ""
-"De poging om de aanpassingen in '/etc' vast te leggen in git is mislukt."
+"De poging om de aanpassingen in '/etc' vast te leggen in ${VCS} is mislukt."
#. Type: error
#. Description
diff --git a/debian/po/pt.po b/debian/po/pt.po
index aaea57e..5c88dd5 100644
--- a/debian/po/pt.po
+++ b/debian/po/pt.po
@@ -19,19 +19,19 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:2001
-msgid "Commit changed files in /etc to git?"
-msgstr "Submeter ficheiros alterados em /etc para o git?"
+msgid "Commit changed files in /etc to ${VCS}?"
+msgstr "Submeter ficheiros alterados em /etc para o ${VCS}?"
#. Type: boolean
#. Description
#: ../templates:2001
msgid ""
"The /etc directory contains uncommitted files or other changes. It's best "
-"for all files in /etc to be committed to git before running APT. Added and "
+"for all files in /etc to be committed to ${VCS} before running APT. Added and "
"changed files listed below can be committed automatically:"
msgstr ""
"O directório /etc contém ficheiros não submetidos ou outras alterações. É "
-"melhor que todos os ficheiros em /etc sejam submetidos ao git antes de "
+"melhor que todos os ficheiros em /etc sejam submetidos ao ${VCS} antes de "
"correr o APT. Os ficheiros adicionados e alterados da lista em baixo podem "
"ser submetidos automaticamente:"
@@ -44,8 +44,8 @@ msgstr "Submissão falhada"
#. Type: error
#. Description
#: ../templates:3001
-msgid "An attempt to commit /etc changes to git failed."
-msgstr "A tentativa de submeter as alterações de /etc ao git falhou."
+msgid "An attempt to commit /etc changes to ${VCS} failed."
+msgstr "A tentativa de submeter as alterações de /etc ao ${VCS} falhou."
#. Type: error
#. Description
diff --git a/debian/po/ru.po b/debian/po/ru.po
index 9255a6d..d85ec38 100644
--- a/debian/po/ru.po
+++ b/debian/po/ru.po
@@ -21,19 +21,19 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:2001
-msgid "Commit changed files in /etc to git?"
-msgstr "Зафиксировать изменённые файлы /etc в git?"
+msgid "Commit changed files in /etc to ${VCS}?"
+msgstr "Зафиксировать изменённые файлы /etc в ${VCS}?"
#. Type: boolean
#. Description
#: ../templates:2001
msgid ""
"The /etc directory contains uncommitted files or other changes. It's best "
-"for all files in /etc to be committed to git before running APT. Added and "
+"for all files in /etc to be committed to ${VCS} before running APT. Added and "
"changed files listed below can be committed automatically:"
msgstr ""
"Каталог /etc содержит незафиксированные файлы или другие изменения. Перед "
-"работой APT лучше зафиксировать все файлы /etc в git. Перечисленные ниже "
+"работой APT лучше зафиксировать все файлы /etc в ${VCS}. Перечисленные ниже "
"добавленные и изменённые файлы могут быть зафиксированы автоматически:"
#. Type: error
@@ -45,8 +45,8 @@ msgstr "Фиксация завершилась неудачно"
#. Type: error
#. Description
#: ../templates:3001
-msgid "An attempt to commit /etc changes to git failed."
-msgstr "Попытка зафиксировать изменения /etc в git завершилась неудачно."
+msgid "An attempt to commit /etc changes to ${VCS} failed."
+msgstr "Попытка зафиксировать изменения /etc в ${VCS} завершилась неудачно."
#. Type: error
#. Description
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
index 6637bdf..756b2e2 100644
--- a/debian/po/templates.pot
+++ b/debian/po/templates.pot
@@ -19,7 +19,7 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:2001
-msgid "Commit changed files in /etc to git?"
+msgid "Commit changed files in /etc to ${VCS}?"
msgstr ""
#. Type: boolean
@@ -27,7 +27,7 @@ msgstr ""
#: ../templates:2001
msgid ""
"The /etc directory contains uncommitted files or other changes. It's best "
-"for all files in /etc to be committed to git before running APT. Added and "
+"for all files in /etc to be committed to ${VCS} before running APT. Added and "
"changed files listed below can be committed automatically:"
msgstr ""
@@ -40,7 +40,7 @@ msgstr ""
#. Type: error
#. Description
#: ../templates:3001
-msgid "An attempt to commit /etc changes to git failed."
+msgid "An attempt to commit /etc changes to ${VCS} failed."
msgstr ""
#. Type: error
diff --git a/debian/postinst b/debian/postinst
index 33891dd..ef872b3 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -22,16 +22,34 @@ case "$1" in
configure)
if dpkg --compare-versions "$2" le "0.7"; then
if [ -d /etc/etckeeper/pre-apt.d ]; then
- for c in README 50uncommitted-changes; do
- mv_conffile "/etc/etckeeper/pre-apt.d/$c" "/etc/etckeeper/pre-install.d/$c"
- done
+ mv_conffile "/etc/etckeeper/pre-apt.d/README" \
+ "/etc/etckeeper/pre-install.d/README"
+ mv_conffile "/etc/etckeeper/pre-apt.d/50uncommitted-changes" \
+ "/etc/etckeeper/pre-install.d/50uncommitted-changes"
rmdir --ignore-fail-on-non-empty /etc/etckeeper/pre-apt.d
fi
if [ -d /etc/etckeeper/post-apt.d ]; then
- for c in README 10git-test 30git-add 40git-rm 50git-commit; do
- mv_conffile "/etc/etckeeper/post-apt.d/$c" "/etc/etckeeper/post-install.d/$c"
- done
+ mv_conffile "/etc/etckeeper/post-apt.d/README" \
+ "/etc/etckeeper/post-install.d/README"
+ mv_conffile "/etc/etckeeper/post-apt.d/10git-test" \
+ "/etc/etckeeper/post-install.d/10vcs-test"
+ mv_conffile "/etc/etckeeper/post-apt.d/30git-add" \
+ "/etc/etckeeper/post-install.d/30git-add"
+ mv_conffile "/etc/etckeeper/post-apt.d/40git-rm" \
+ "/etc/etckeeper/post-install.d/40git-rm"
+ mv_conffile "/etc/etckeeper/post-apt.d/50git-commit" \
+ "/etc/etckeeper/post-install.d/50vcs-commit"
rmdir --ignore-fail-on-non-empty /etc/etckeeper/post-apt.d
fi
+ mv_conffile "/etc/etckeeper/init.d/40git-init" \
+ "/etc/etckeeper/init.d/40vcs-init"
+ mv_conffile "/etc/etckeeper/init.d/50git-ignore" \
+ "/etc/etckeeper/init.d/50vcs-ignore"
+ mv_conffile "/etc/etckeeper/init.d/50git-perm" \
+ "/etc/etckeeper/init.d/50vcs-perm"
+ mv_conffile "/etc/etckeeper/init.d/50git-pre-commit-hook" \
+ "/etc/etckeeper/init.d/50vcs-pre-commit-hook"
+ mv_conffile "/etc/etckeeper/init.d/70git-add" \
+ "/etc/etckeeper/init.d/70git-add"
fi
esac
diff --git a/debian/preinst b/debian/preinst
index f4a086f..f1ce59a 100644
--- a/debian/preinst
+++ b/debian/preinst
@@ -25,5 +25,9 @@ install|upgrade)
for c in README 10git-test 30git-add 40git-rm 50git-commit; do
prep_mv_conffile "/etc/etckeeper/post-apt.d/$c"
done
+ for c in 40git-init 50git-ignore 50git-prerm \
+ 50git-pre-commit-hook 70git-add; do
+ prep_mv_conffile "/etc/etckeeper/init.d/$c"
+ done
fi
esac
diff --git a/debian/rules b/debian/rules
index b56b152..eb737a5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,7 +14,7 @@ binary-indep: build
dh_testdir
dh_testroot
dh_clean -k
- $(MAKE) install PREFIX=debian/etckeeper
+ $(MAKE) install DESTDIR=debian/etckeeper
dh_installdocs README TODO
dh_installexamples
dh_installchangelogs
diff --git a/debian/templates b/debian/templates
index 565c703..87f634b 100644
--- a/debian/templates
+++ b/debian/templates
@@ -11,10 +11,10 @@ Template: etckeeper/unclean
Type: boolean
Default: true
#flag:translate!:3
-_Description: Commit changed files in /etc to git?
+_Description: Commit changed files in /etc to ${VCS}?
The /etc directory contains uncommitted files
or other changes. It's best for all files in /etc to be committed
- to git before running APT. Added and changed files listed below can
+ to ${VCS} before running APT. Added and changed files listed below can
be committed automatically:
.
${STATUS}
@@ -22,7 +22,7 @@ _Description: Commit changed files in /etc to git?
Template: etckeeper/commit_failed
Type: error
_Description: Commit failed
- An attempt to commit /etc changes to git failed.
+ An attempt to commit /etc changes to ${VCS} failed.
.
You may manually resolve the issues with the uncommitted changes
before continuing.
diff --git a/etckeeper.1 b/etckeeper.1
index 6d00cdb..cd31b5d 100644
--- a/etckeeper.1
+++ b/etckeeper.1
@@ -1,24 +1,25 @@
.\" -*- nroff -*-
.TH ETCKEEPER 1 "" "" ""
.SH NAME
-etckeeper \- store /etc in git
+etckeeper \- store /etc in git or mercurial
.SH SYNOPSIS
.B etckeeper command [directory]
.SH DESCRIPTION
-etckeeper manages /etc be stored in a git repository. By default each
-of the commands operates on /etc, but a different directory can be
-specified as a parameter to operate on a clone of the /etc repository
+etckeeper manages /etc be stored in a git or mercurial repository. By
+default each of the commands operates on /etc, but a different directory
+can be specified as a parameter to operate on a clone of the /etc repository
located elsewhere.
.SH COMMANDS
.TP
.B init
This is the only command you typically need to run by hand. It initialises
-and sets up a git repository. Typically this is run in /etc once when
-starting to use etckeeper on a machine. It can also be used to initialise
+and sets up a git or mercurial repository (depending on the VCS setting in
+/etc/etckeeper/etckeeper.conf). Typically this is run in /etc once
+when starting to use etckeeper on a machine. It can also be used to initialise
a clone of the /etc repository located elsewhere.
.TP
.B pre-commit
-This is called as a git pre-commit hook. It stores metadata and does sanity
+This is called as a pre-commit hook. It stores metadata and does sanity
checks.
.TP
.B pre-install
@@ -30,5 +31,10 @@ packages are installed, upgraded, etc.
This is called by apt's DPkg::Post-Invoke hook, or by equivilant hooks
of other package managers. It commits changes made by packages into the
repository. (You can also call this by hand after running dpkg by hand.)
+.SH FILES
+/etc/etckeeper/etckeeper.conf is the configuration file.
+
+/etc/etckeeper also contains directories containing the programs that are
+run for each of the above commands.
.SH AUTHOR
Joey Hess, <joey@kitenet.net>.
diff --git a/pre-install.d/50uncommitted-changes b/pre-install.d/50uncommitted-changes
index 30a6fd7..3bfc037 100755
--- a/pre-install.d/50uncommitted-changes
+++ b/pre-install.d/50uncommitted-changes
@@ -37,6 +37,7 @@ if unclean; then
db_title etckeeper
db_reset etckeeper/unclean || true
+ db_subst etckeeper/unclean VCS "$VCS"
db_subst etckeeper/unclean STATUS $(status | debconf-escape -e) || true
db_input critical etckeeper/unclean || true
db_go || true
@@ -45,6 +46,7 @@ if unclean; then
if [ "$RET" = true ]; then
if ! commit "saving uncommitted changes in /etc prior to $HIGHLEVEL_PACKAGE_MANAGER run"; then
if [ -e /usr/share/debconf/confmodule ]; then
+ db_subst etckeeper/commit_failed VCS "$VCS"
db_input critical etckeeper/commit_failed || true
db_go || true
db_reset etckeeper/commit_failed || true