summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README4
-rwxr-xr-xetckeeper6
-rw-r--r--etckeeper.125
3 files changed, 18 insertions, 17 deletions
diff --git a/README b/README
index 7a2268c..df1f463 100644
--- a/README
+++ b/README
@@ -62,7 +62,6 @@ contains such special files.
A quick walkthrough of using etckeeper.
- cd /etc
etckeeper init
The `etckeeper init` command initialises an /etc/.git/ repository. This
@@ -74,6 +73,7 @@ commit. So you might want to use 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:
+ cd /etc
git commit -m "initial checkin"
git gc # pack git repo to save a lot of space
@@ -105,7 +105,7 @@ shadow, before `etckeeper init` fixes their permissions:
chmod 700 .
git clone /etc
cd etc
- etckeeper init
+ etckeeper init .
chmod 755 ..
Another common reason to clone the repository is to make a backup to a
diff --git a/etckeeper b/etckeeper
index 5aa4208..5606b72 100755
--- a/etckeeper
+++ b/etckeeper
@@ -13,10 +13,10 @@ if [ ! -d "/etc/etckeeper/$command.d" ]; then
exit 1
fi
-if [ "$command" = post-apt ] || [ "$command" = pre-apt ]; then
- cd /etc
-elif [ "$command" = pre-commit ] && [ -n "$1" ]; then
+if [ -n "$1" ]; then
cd "$1"
+else
+ cd /etc
fi
run-parts "/etc/etckeeper/$command.d"
diff --git a/etckeeper.1 b/etckeeper.1
index 8836e4b..2d38bf8 100644
--- a/etckeeper.1
+++ b/etckeeper.1
@@ -3,30 +3,31 @@
.SH NAME
etckeeper \- store /etc in git
.SH SYNOPSIS
-.B etckeeper command [args]
+.B etckeeper command [directory]
.SH DESCRIPTION
-etckeeper is a collection of tools to let /etc be stored in a git
-repository. Please see its README for more detailed information.
+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
+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 for the current directory. 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.
+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
+a clone of the /etc repository located elsewhere.
.TP
.B pre-commit
-This is called as a git pre-commit hook. It should be passed the name
-of the toplevel directory of the repository (typically /etc). It stores
-metadata and does sanity checks.
+This is called as a git pre-commit hook. It stores metadata and does sanity
+checks.
.TP
.B pre-apt
This is called by apt's DPkg::Pre-Install-Pkgs hook. It allows committing
-any uncommitted changes in /etc before the apt run.
+any uncommitted changes before the apt run.
.TP
.B post-apt
This is called by apt's DPkg::Post-Invoke hook. It commits changes made by
-packages to files in /etc into the repository. (You can also call this by
-hand after running dpkg by hand.)
+packages into the repository. (You can also call this by hand after running
+dpkg by hand.)
.SH AUTHOR
Joey Hess, <joey@kitenet.net>.