diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2007-11-05 16:00:32 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2007-11-05 16:00:32 -0500 |
commit | 34320131ce680fe03febc9f4d6b438f05e548cbc (patch) | |
tree | 41c91d7ad68331e1fa2525c43d43e6c04899b09b | |
parent | 3e6cf464cff47d22f4ac4b4313fda68f32ae1ea8 (diff) |
rename etc-* to etckeeper-*
-rw-r--r-- | README | 41 | ||||
-rwxr-xr-x | etckeeper | 4 | ||||
-rwxr-xr-x | init.d/10restore-metadata (renamed from etc-init.d/10restore-metadata) | 0 | ||||
-rwxr-xr-x | init.d/20git-init (renamed from etc-init.d/20git-init) | 0 | ||||
-rwxr-xr-x | init.d/30git-perm (renamed from etc-init.d/30git-perm) | 0 | ||||
-rwxr-xr-x | init.d/40git-ignore (renamed from etc-init.d/40git-ignore) | 0 | ||||
-rwxr-xr-x | init.d/40git-pre-commit-hook (renamed from etc-init.d/40git-pre-commit-hook) | 8 | ||||
-rw-r--r-- | init.d/README (renamed from etc-init.d/README) | 5 | ||||
-rw-r--r-- | post-apt.d/README (renamed from etc-post-apt.d/README) | 0 | ||||
-rw-r--r-- | pre-apt.d/README (renamed from etc-pre-apt.d/README) | 0 | ||||
-rw-r--r-- | pre-commit.d/README (renamed from etc-pre-commit.d/README) | 0 |
11 files changed, 29 insertions, 29 deletions
@@ -28,10 +28,10 @@ repository. etckeeper has special support to handle changes to /etc caused by installing and upgrading packages. Before apt installs packages, -`etc-pre-apt` will check that /etc is clean, and if it's not, prompt you -about whether or not to continue. (This check can be disabled.) After apt -installs packages, `etc-post-apt` will add any new interesting files to the -repository, and commit the changes. +`etckeeper-pre-apt` will check that /etc is clean, and if it's not, prompt +you about whether or not to continue. (This check can be disabled.) After +apt installs packages, `etckeeper-post-apt` 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 @@ -40,17 +40,17 @@ 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, `etc-init` sets up -a git hook that use `metastore` to store metadata about file owners, -permissions, modification times, and even extended attributes. This +storage is handled by `metastore`. Amoung other chores, `etckeeper-init` +sets up a git hook that use `metastore` to store metadata about file +owners, permissions, modification times, and even extended attributes. 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. So `etc-init` also sets up a git hook -to run `etc-pre-commit`, which checks for empty directories before -committing, and warn about them. You can then either ignore the empty -directory, if it's not significant, or put a file (such as `.gitignore`) in -the directory to enable git to track it. +git cannot track empty directories. So `etckeeper-init` also sets up a git +hook to run `etckeeper-pre-commit`, which checks for empty directories +before committing, and warn about them. You can then either ignore the +empty directory, if it's not significant, or put a file (such as +`.gitignore`) in the directory to enable git to track it. 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 @@ -63,11 +63,10 @@ contains such untrackable special files. A quick walkthrough of using etckeeper. cd /etc - etc-init + etckeeper-init -This `etc-init` command, which is actually run for you when the Debian -package of etckeeper is installed, initialises an /etc/.git/ repository. -This command is careful to never overwrite existing file or directories in +This `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 @@ -88,7 +87,7 @@ Rinse, lather, repeat. etckeeper hooks into apt so changed or new files caused by installing or upgrading packages will automatically be added and committed. -(`etc-post-apt` uses `git-add .`, so any new files in /etc that arn't +(`etckeeper-post-apt` uses `git-add .`, so any new files in /etc that arn't gitignored will be added.) If a package *removes* a file from /etc, etckeeper does not automatically @@ -104,13 +103,13 @@ on your system's /etc. Often it's better to clone /etc to elsewhere and do potentially dangerous stuff in a staging directory. You can clone the repository using git-clone, but be careful that the directory it's cloned into starts out mode 700, to prevent anyone else from seeing files like -shadow, before `etc-init` fixes their permissions: +shadow, before `etckeeper-init` fixes their permissions: mkdir /my/clone cd /my/clone chmod 700 . git clone /etc - etc-init + etckeeper-init chmod 755 . Another common reason to clone the repository is to make a backup to a @@ -129,12 +128,12 @@ sky's the limit.. ## configuration -Each etc-foo command uses `run-parts` to run the executable files in +Each etckeeper-foo command uses `run-parts` to run the executable files in /etc/etckeeper/foo.d/. By default these directories contain a bunch of symlinks to the actual files; you can remove or reorder the symlinks, or add your own custom files. -Note that the etc-foo commands are careful to not hardcode anything about +Note that the etckeeper-foo 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. @@ -2,9 +2,9 @@ set -e if [ "$0" != etckeeper ]; then - command="$(basename $0)" + command="$(basename $0 | sed -e s/etckeeper-//)" else - command="etc-$1" + command="$1" shift 1 fi diff --git a/etc-init.d/10restore-metadata b/init.d/10restore-metadata index 4ce97ed..4ce97ed 100755 --- a/etc-init.d/10restore-metadata +++ b/init.d/10restore-metadata diff --git a/etc-init.d/20git-init b/init.d/20git-init index 7bf1c89..7bf1c89 100755 --- a/etc-init.d/20git-init +++ b/init.d/20git-init diff --git a/etc-init.d/30git-perm b/init.d/30git-perm index 564e489..564e489 100755 --- a/etc-init.d/30git-perm +++ b/init.d/30git-perm diff --git a/etc-init.d/40git-ignore b/init.d/40git-ignore index 846c32d..846c32d 100755 --- a/etc-init.d/40git-ignore +++ b/init.d/40git-ignore diff --git a/etc-init.d/40git-pre-commit-hook b/init.d/40git-pre-commit-hook index e7b58e0..360be8c 100755 --- a/etc-init.d/40git-pre-commit-hook +++ b/init.d/40git-pre-commit-hook @@ -1,16 +1,16 @@ #!/bin/sh set -e if [ -x .git/hooks/pre-commit ]; then - if ! grep -q etc-pre-commit .git/hooks/pre-commit; then - echo "warning: .git/hooks/pre-commit needs to be manually modifed to run etc-pre-commit" >&2 + if ! grep -q etckeeper-pre-commit .git/hooks/pre-commit; then + echo "warning: .git/hooks/pre-commit needs to be manually modifed to run etckeeper-pre-commit" >&2 fi else echo <<EOF >>.git/hooks/pre-commit #!/bin/sh -# pre-commit hook for etckeeper. Calls etc-pre-commit to store metadata +# pre-commit hook for etckeeper. Calls etckeeper-pre-commit to store metadata # and do sanity checks. set -e -etc-pre-commit +etckeeper-pre-commit EOF chmod +x .git/hooks/pre-commit fi diff --git a/etc-init.d/README b/init.d/README index 8fe4cd1..90aec67 100644 --- a/etc-init.d/README +++ b/init.d/README @@ -6,7 +6,8 @@ it includes applying stored metadata to the checked out files in the working directory. Please be careful to *never* overwrite existing files/directories -in the working directory. If a file you need to write already exists, check -if its contents are sane, and if not, emit a warning on stderr. +in the working directory (or use absolute care when doing so). If a file +you need to write already exists, check if its contents are sane, and +if not, emit a warning on stderr. If initialisation fails, exit nonzero and no later files will be run. diff --git a/etc-post-apt.d/README b/post-apt.d/README index 34b65ac..34b65ac 100644 --- a/etc-post-apt.d/README +++ b/post-apt.d/README diff --git a/etc-pre-apt.d/README b/pre-apt.d/README index aadbd4f..aadbd4f 100644 --- a/etc-pre-apt.d/README +++ b/pre-apt.d/README diff --git a/etc-pre-commit.d/README b/pre-commit.d/README index 051d094..051d094 100644 --- a/etc-pre-commit.d/README +++ b/pre-commit.d/README |