diff options
68 files changed, 1962 insertions, 398 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5d42584 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +debian/changelog merge=dpkg-mergechangelogs @@ -14,24 +14,36 @@ INSTALL=install INSTALL_EXE=${INSTALL} -D INSTALL_DATA=${INSTALL} -m 0644 -D -build: +build: etckeeper.spec -./etckeeper-bzr/__init__.py build || echo "** bzr support not built" - + install: mkdir -p $(DESTDIR)$(etcdir)/etckeeper/ $(DESTDIR)$(vardir)/cache/etckeeper/ - cp -a *.d $(DESTDIR)$(etcdir)/etckeeper/ + cp -dR *.d $(DESTDIR)$(etcdir)/etckeeper/ $(INSTALL_DATA) $(CONFFILE) $(DESTDIR)$(etcdir)/etckeeper/etckeeper.conf $(INSTALL_EXE) etckeeper $(DESTDIR)$(bindir)/etckeeper - $(INSTALL_DATA) etckeeper.1 $(DESTDIR)$(mandir)/man1/etckeeper.1 + $(INSTALL_DATA) etckeeper.8 $(DESTDIR)$(mandir)/man8/etckeeper.8 $(INSTALL_DATA) bash_completion $(DESTDIR)$(etcdir)/bash_completion.d/etckeeper ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),apt) $(INSTALL_DATA) apt.conf $(DESTDIR)$(etcdir)/apt/apt.conf.d/05etckeeper + mkdir -p $(DESTDIR)$(etcdir)/cruft/filters-unex + $(INSTALL_DATA) cruft_filter $(DESTDIR)$(etcdir)/cruft/filters-unex/etckeeper endif ifeq ($(LOWLEVEL_PACKAGE_MANAGER),pacman-g2) $(INSTALL_DATA) pacman-g2.hook $(DESTDIR)$(etcdir)/pacman-g2/hooks/etckeeper endif - -./etckeeper-bzr/__init__.py install --root=$(DESTDIR) || echo "** bzr support not installed" +ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),yum) + $(INSTALL_DATA) yum-etckeeper.py $(DESTDIR)$(prefix)/lib/yum-plugins/etckeeper.py + $(INSTALL_DATA) yum-etckeeper.conf $(DESTDIR)$(etcdir)/yum/pluginconf.d/etckeeper.conf +endif + -./etckeeper-bzr/__init__.py install --root=$(DESTDIR) ${PYTHON_INSTALL_OPTS} || echo "** bzr support not installed" echo "** installation successful" -clean: +clean: etckeeper.spec rm -rf build + +etckeeper.spec: + sed -i~ "s/Version:.*/Version: $$(perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)/" etckeeper.spec + rm -f etckeeper.spec~ + +.PHONY: etckeeper.spec @@ -1,14 +1,15 @@ etckeeper is a collection of tools to let /etc be stored in a git, -mercurial, or bazaar repository. It hooks into apt to automatically commit -changes made to /etc during package upgrades. It tracks 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. +mercurial, bazaar or darcs repository. It hooks into apt to automatically +commit changes made to /etc during package upgrades. It tracks 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. + ## security warnings -First, a big warning: By checking /etc into revision control, you are +First, a big warning: By checking /etc into version control, you are creating a copy of files like /etc/shadow that must remain secret. Anytime you have a copy of a secret file, it becomes more likely that the file contents won't remain secret. etckeeper is careful about file permissions, @@ -20,7 +21,7 @@ Since git mushes all the files into packs under the .git directory, the whole .git directory content needs to be kept secret. (Ditto for mercurial and .hg as well as bazaar and .bzr) -Also, since revision control systems don't keep track of the mode of files +Also, since version 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. @@ -37,53 +38,69 @@ 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. -Revsion control systems are designed as a way to manage source code, not as +You can also run `etckeeper commit` by hand to commit changes. + +There is also a cron job, that will use etckeeper to automatically +commit any changes to /etc each day. + + +## VCS limitations + +Version 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. Most VCS, including git, mercurial and bazaar 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 stored separately. -Among other chores, `etckeeper init` sets up a `pre-commit` hook that stores -metadata about file owners and permissions into a `/etc/.metadata` file. -This metadata is stored in version control along with everything else, and -can be applied if the repo should need to be checked back out. +permissions or owner info. (darcs doesn't even track executable bits.) So +file metadata storage is stored separately. Among other chores, `etckeeper +init` sets up a `pre-commit` hook that stores metadata about file owners +and permissions into a `/etc/.metadata` file. This metadata is stored in +version control along with everything else, and can be applied if the repo +should need to be checked back out. 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. -Most VCS, including git, mercurial, and bazaar 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. +Most VCS don't support several special files that you _probably_ won't have +in /etc, such as unix sockets, named pipes, hardlinked files (but symlinks +are fine), and device files. The `pre-commit` hook will warn if your /etc +contains such special files. + +Darcs doesn't support symlinks, so they are also stored in +`/etc/.etckeeper`. ## tutorial 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 and bazaar are similar. +Note that the default VCS is git, and this tutorial assumes you're using +it. Using other VCSes should be broadly 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. +The `etckeeper init` command initialises an /etc/.git/ repository. +If you installed etckeeper from a package, this was probably automatically +performed during the package installation. If not, your first step is to +run it by hand: etckeeper init +The `etckeeper init` command is careful to never overwrite existing files +or directories in /etc. It will create a `.gitignore` if one doesn't +already exist (or update content inside a "managed by etckeeper" comment +block), 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. + 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: cd /etc + git status git commit -m "initial checkin" git gc # pack git repo to save a lot of space @@ -101,9 +118,10 @@ daemons and shouldn't be tracked by git. These can be removed from git: echo printcap >> .gitignore git commit -a -m "don't track printcap" -etckeeper hooks into apt so changes to interesting files in /etc caused by -installing or upgrading packages will automatically be committed. Here -"interesting" means files that are not ignored by `.gitignore`. +etckeeper hooks into apt (and similar systems) so changes to interesting +files in /etc caused by installing or upgrading packages will automatically +be committed. Here "interesting" means files that are not ignored by +`.gitignore`. You can use any git commands you like, but do keep in mind that, if you check out a different branch or an old version, git is operating directly @@ -132,8 +150,9 @@ server. When using git push to create a new remote clone, make sure the new remote clone is mode 700! (And, obviously, only push over a secure transport like ssh, and only to a server you trust.) - ssh server 'mkdir /etc-clone; cd /etc-clone; chmod 700 .; git init' - git push ssh://server/etc-clone master + ssh server 'mkdir /etc-clone; cd /etc-clone; chmod 700 .; git init --bare' + git remote add backup ssh://server/etc-clone + git push backup --all If you have several machine's using etckeeper, you can start with a etckeeper repository on one machine, then add another machine's etckeeper @@ -165,6 +184,7 @@ Of course, it's also possible to pull changes from a server onto client machines, to deploy changes to /etc. Once /etc is under version control, the sky's the limit.. + ## configuration The main configuration file is `/etc/etckeeper/etckeeper.conf` @@ -188,6 +208,35 @@ letting it git add new files and git rm removed ones: chmod -x /etc/etckeeper/commit.d/50vcs-commit +Here's how to make it automatically push commits to a clone of the +repository as a backup (see instructions above to set up the clone safely): + + cd /etc/etckeeper/commit.d + (echo '#!/bin/sh' ; echo 'git push backup') > 99git-push + chmod +x 99git-push + git add . + git commit -m "automatically push commits to backup repository" + +## changing VCS + +By default, etckeeper uses git. If you would like to use some other VCS, +and `etckeeper init` has already been run to set up a git repository, you +have a decision to make: Is the history recorded in that repository +something you need to preserve, or can you afford to just blow it away +and check the current /etc into the new VCS? + +In the latter case, you just need to follow three steps: + + etckeeper uninit # deletes /etc/.git! + vim /etc/etckeeper/etckeeper.conf + etckeeper init + +In the former case, you will need to convert the git repository to the +other VCS using whatever tools are available to do that. Then you can +run `etckeeper uninit`, move files your new VCS will use into place, +edit `etckeeper.conf` to change the VCS setting, and finally +`etckeeper init`. This procedure is clearly only for the brave. + ## inspiration @@ -24,8 +24,3 @@ This is already doable, would just need modifying the pre-install and post-instlal stuff (ie, it needs to commit in the subdirs too). Using mr would be a possibility.. - -* Figure out what packages were acted on, and include that info in the commit - message - - Done for dpkg, but not for other package managers like rpm. @@ -1,5 +1,5 @@ -DPkg::Pre-Install-Pkgs { "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi"; }; +DPkg::Pre-Invoke { "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi"; }; DPkg::Post-Invoke { "if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi"; }; -RPM::Pre-Install-Pkgs { "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi"; }; +RPM::Pre-Invoke { "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi"; }; RPM::Post-Invoke { "if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi"; }; diff --git a/commit.d/10vcs-test b/commit.d/10vcs-test index 1fd4226..e33d734 100755 --- a/commit.d/10vcs-test +++ b/commit.d/10vcs-test @@ -12,4 +12,6 @@ elif [ "$VCS" = hg ] && [ ! -d .hg ]; then not_enabled_warning elif [ "$VCS" = bzr ] && [ ! -d .bzr ]; then not_enabled_warning +elif [ "$VCS" = darcs ] && [ ! -d _darcs ]; then + not_enabled_warning fi diff --git a/commit.d/30darcs-add b/commit.d/30darcs-add new file mode 100755 index 0000000..98be4bf --- /dev/null +++ b/commit.d/30darcs-add @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +if [ "$VCS" = darcs ] && [ -d _darcs ]; then + rc=0 + res=$( darcs add -qr . 2>&1 ) || rc=$? + if test $rc -ne 0; then + if ! test $rc -eq 2 -a "${res%No files were added}" != "$res"; then + printf "%s" "$res" + echo "etckeeper warning: darcs add failed" >&2 + fi + fi + unset rc res +fi diff --git a/commit.d/40git-rm b/commit.d/40git-rm new file mode 100755 index 0000000..ae70e1f --- /dev/null +++ b/commit.d/40git-rm @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +if [ "$VCS" = git ] && [ -d .git ]; then + if ! git add . -u; then + echo "etckeeper warning: git add -u failed" >&2 + fi +fi diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit index 86fe8fb..d484626 100755 --- a/commit.d/50vcs-commit +++ b/commit.d/50vcs-commit @@ -1,24 +1,89 @@ #!/bin/sh set -e -message="$1" +cleanup () { + if [ -n "$logfile" ]; then + rm -f "$logfile" + fi +} +if [ -n "$1" ]; then + trap cleanup EXIT + logfile="$(mktemp -t etckeeper-$VCS.XXXXXXXXXX)" + if [ "x$1" = "x--stdin" ]; then + cat > "$logfile" + else + if [ "x$1" = "x-m" ]; then + shift 1 + fi + echo "$1" > "$logfile" + fi +else + logfile="" +fi + +hostname=`hostname` +hostname="${hostname%%.*}" +dnsdomainname=`dnsdomainname 2>/dev/null || true` +if [ -n "$dnsdomainname" ]; then + hostname="$hostname.$dnsdomainname" +fi + +USER= +if [ -n "$SUDO_USER" ]; then + USER="$SUDO_USER" +else + # try to check tty ownership, in case user su'd to root + TTY="$(tty 2>/dev/null || true)" + if [ -n "$TTY" ] && [ -c "$TTY" ]; then + USER="$(find "$TTY" -printf "%u")" + fi +fi if [ "$VCS" = git ] && [ -d .git ]; then - if [ -n "$message" ]; then - git commit $GIT_COMMIT_OPTIONS -m "$message" + if [ -n "$USER" ]; then + if [ -z "$GIT_AUTHOR_NAME" ]; then + export GIT_AUTHOR_NAME="$USER" + fi + if [ -z "$GIT_AUTHOR_EMAIL" ]; then + export GIT_AUTHOR_EMAIL="$USER@$hostname" + fi + if [ -z "$GIT_COMMITTER_EMAIL" ]; then + export GIT_COMMITTER_EMAIL=`whoami`"@$hostname" + fi + fi + if [ -n "$logfile" ]; then + git commit $GIT_COMMIT_OPTIONS -F "$logfile" else git commit $GIT_COMMIT_OPTIONS fi elif [ "$VCS" = hg ] && [ -d .hg ]; then - if [ -n "$message" ]; then - hg commit $HG_COMMIT_OPTIONS -m "$message" + if [ -n "$USER" ]; then + export LOGNAME="$USER" + fi + if [ -z "$HGUSER" ]; then + export HGUSER="$USER@$hostname" + fi + if [ -n "$logfile" ]; then + hg commit $HG_COMMIT_OPTIONS -l "$logfile" else hg commit $HG_COMMIT_OPTIONS fi elif [ "$VCS" = bzr ] && [ -d .bzr ]; then - if [ -n "$message" ]; then - bzr commit $BZR_COMMIT_OPTIONS -m "$message" + if [ -z "$EMAIL" ] && [ -n "$USER" ]; then + export EMAIL="$USER <$USER@$hostname>" + fi + if [ -n "$logfile" ]; then + bzr commit $BZR_COMMIT_OPTIONS -F "$logfile" else bzr commit $BZR_COMMIT_OPTIONS fi +elif [ "$VCS" = darcs ] && [ -d _darcs ]; then + if [ -z "$USER" ]; then + USER=root + fi + if [ -n "$logfile" ]; then + darcs record --author="$USER" $DARCS_COMMIT_OPTIONS --logfile="$logfile" + else + darcs record --author="$USER" $DARCS_COMMIT_OPTIONS + fi fi diff --git a/cruft_filter b/cruft_filter new file mode 100644 index 0000000..edd5f33 --- /dev/null +++ b/cruft_filter @@ -0,0 +1,13 @@ +/etc/.etckeeper +/etc/.gitignore +/etc/.git +/etc/.git/** +/etc/.hgignore +/etc/.hg +/etc/.hg/** +/etc/.bzrignore +/etc/.bzr +/etc/.bzr/** +/etc/.darcsignore +/etc/_darcs +/etc/_darcs/** diff --git a/debian/changelog b/debian/changelog index b1521a3..2dba9a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,388 @@ -etckeeper (0.22) UNRELEASED; urgency=low +etckeeper (0.58) UNRELEASED; urgency=low - * Use new git add -A from git 1.6.0 (Miklos Vajna) + * Changed to store all permissions of files and directories, even those + with standard permissions of 644 and 755. This is unfortunately necessary + in order to support etckeeper init on a checkout that was made with a + nonstandard umask, in which case the files that were expected to be + 644 and 755, won't be. Closes: #649701 + Thanks to Дмитрий Матросов for reporting the bug and developing + a fixup script (attached to the bug) which could be used if you've + already encountered this problem. + * Bugfix for filenames containing single quotes. + * Use git add -A, which automatically removes deleted files, + and avoids a separate call to git add -u. + Thanks to Miklos Vajna, whose patch in 2008 was deferred + because -A was then too new, and languished in a branch until found today. - -- Joey Hess <joeyh@debian.org> Sun, 14 Sep 2008 18:46:08 -0400 + -- Joey Hess <joeyh@debian.org> Fri, 25 Nov 2011 12:00:55 -0400 + +etckeeper (0.57) unstable; urgency=low + + * Use find -path instead of less portable find -wholename. + + -- Joey Hess <joeyh@debian.org> Fri, 04 Nov 2011 17:03:46 -0400 + +etckeeper (0.56) unstable; urgency=low + + * Converted to use dh_python2. Closes: #616800 + * Handle files with % in their names. + + -- Joey Hess <joeyh@debian.org> Tue, 12 Jul 2011 14:38:09 -0400 + +etckeeper (0.55) unstable; urgency=low + + * Fix error propigation to yum, which makes AVOID_COMMIT_BEFORE_INSTALL work. + Closes: https://bugzilla.redhat.com/show_bug.cgi?id=709487 + Thanks, Thomas Moschny + * Avoid being noisy in post-install after automatic yum updates. + (Tuomo Soini) + * Ignore FHS violating prelink.cache and openvpn-status.log. + * Ignore *.LOCK files, as used by selinux policies. + * Add AVOID_SPECIAL_FILE_WARNING to config file, and set it in cron + job to avoid daily noise. (gulikoza) + + -- Joey Hess <joeyh@debian.org> Sun, 19 Jun 2011 15:21:20 -0400 + +etckeeper (0.54) unstable; urgency=low + + * Ignore inssev's FHS violating /etc/init.d/.depend.* files. + Closes: #619407 See #619409 + * Use hg pre-commit hook, rather than its precommit hook, + as the latter is run after the files staged for commit are + determined and so .etckeeper cannot be staged as part of the current + commit. Closes: #621827 + + -- Joey Hess <joeyh@debian.org> Mon, 30 May 2011 18:11:40 -0400 + +etckeeper (0.53) unstable; urgency=low + + [ Joey Hess ] + * Install bzr hook lazily, clean up some compatibility code. (Jelmer Vernooij) + + [ Josh Triplett ] + * Only set environment variables for commit authorship (EMAIL, + GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_EMAIL) if they don't + already exist. + + [ Joey Hess ] + * Add .pyc and .pyo files to ignore. + * Add lvm/backup and lvm/cache to ignore. Closes: #462355 + * Avoid warning about special or hard linked files that are ignored + by hg. Thanks Sjoerd Mullender for patch. + Closes: https://bugzilla.redhat.com/show_bug.cgi?id=688991 + + -- Joey Hess <joeyh@debian.org> Fri, 18 Mar 2011 15:37:54 -0400 + +etckeeper (0.52) unstable; urgency=low + + * Rewrote 50git-rm to avoid using git ls-files, and thus avoid encoding + problems with filenames. + + -- Joey Hess <joeyh@debian.org> Sun, 06 Feb 2011 00:00:55 -0400 + +etckeeper (0.51) unstable; urgency=low + + * Updated Vietnamese translation of debconf templates. Closes: #601921 + * Improve rpm version change detection. + * Move etckeeper out of sbin, to avoid needing to work around broken + root PATH settings in eg, crontab. Closes: #602438 + * Added Polish translation of debconf templates. Closes: #607563 + + -- Joey Hess <joeyh@debian.org> Sat, 25 Dec 2010 14:39:57 -0400 + +etckeeper (0.50) unstable; urgency=low + + * Add Danish translation of debconf templates. Closes: #597768 + * Ignore /etc/.initctl. Closes: #598121 + * Do not warn about special files or hardlinks if they are ignored by + git. Fixes #549354 for git, but not for other VCSs. + * Set GIT_COMMITTER_EMAIL to root@$hostname to avoid git prompting + the user to configure it in .gitconfig. Closes: #599749 + * Deal with strange systems that include the domain name in the hostname, + by stripping it. Closes: #600026 + + -- Joey Hess <joeyh@debian.org> Wed, 20 Oct 2010 14:06:21 -0400 + +etckeeper (0.49) unstable; urgency=low + + * Ensure that PATH contains the directory containing etckeeper, so + that hook scripts that re-exec etckeeper are guaranteed to find it. + * Ignore -m switch to etckeeper commit, in case someone tries to use + it with that option common to several VCS. Closes: #592050 + * Remove HOME setting in etckeeper. sudo now defaults to setting HOME + itself as of version 1.7.4p4, so it is not necessary for etckeeper + to work around its behavior anymore. (sudo also allows disabling that + for those who enjoy using guns around feet.) Closes: #583899 + * Fix file quoting problem in processing .etckeeper file in init. + + -- Joey Hess <joeyh@debian.org> Mon, 13 Sep 2010 13:10:43 -0400 + +etckeeper (0.48) unstable; urgency=low + + * Fix backwards test for HGUSER. (Mike Rich) + Closes: #589242 + * 'etckeeper vcs' can be used to run arbitrary VCS subcommands + in the etckeeper environment. (Thanks, Stefan Tomanek) + + -- Joey Hess <joeyh@debian.org> Fri, 16 Jul 2010 15:14:05 -0400 + +etckeeper (0.47) unstable; urgency=low + + * Set HOME=~root so that VCS like bzr do not drop root-owned files in + user home directory when sudo etckeeper is run. Closes: #583581 + * hg: Set HGUSER (if not already set) to avoid warning message when + committing. Closes: #533298 + * Both git and bzr default to showing the author of a commit, + and not the committer. So, set the author to the user running sudo + for both. The committer will then be root. + + -- Joey Hess <joeyh@debian.org> Sun, 30 May 2010 16:50:09 -0400 + +etckeeper (0.46) unstable; urgency=low + + * Support etckeeper commit --stdin + * Fix bug where after a large upgrade, etckeeper's automatic commit message + was so long it exceeded command line length limits. Closes: #581678 + + -- Joey Hess <joeyh@debian.org> Sun, 16 May 2010 19:10:57 -0400 + +etckeeper (0.45) unstable; urgency=low + + * Revert darcs to using --logfile again, necessary for multiline commit + messages. Closes: #577915 + * Fix logic error in darcs user code. Closes: #577918 + + -- Joey Hess <joeyh@debian.org> Thu, 15 Apr 2010 11:50:22 -0400 + +etckeeper (0.44) unstable; urgency=low + + * Add example to README of how to automatically push changes to a backup + repository. + * Add fuse lock file to ignore list. + * Changed darcs to specify --author instead of noting the committing + user inside the commit log. + * Add -a to DARCS_COMMIT_OPTIONS so commits are noninteractive by default, + but users who want darcs prompting can disable it. + * Use darcs record -m to specify commit message, instead of using a logfile. + * Closes: #519228 + * Update depends for git-core to git transition. Closes: #577732 + * Avoid using hostname -f, since on Solaris that sets the hostname to -f. + Yay, Unix portability! (Instead, use dnsdomainname if available, and + otherwise, fall back to the unqualified hostname.) + * Other portability fixes for non-GNU tools and OS X. Thanks, Neil Mayhew. + + -- Joey Hess <joeyh@debian.org> Wed, 14 Apr 2010 15:43:14 -0400 + +etckeeper (0.43) unstable; urgency=low + + * Fix cleanup of /var/cache/etckeeper/packagelist.pre-install after + an upgrade where no conffiles are changed. + * Prevent cron job autocommit from happening if pre-install file + is present, to avoid committing state in the middle of an apt run. + Closes: #567538 + * Add /etc/webmin/webmin/oscache to ignore list. Closes: #567255 + * Check owner of tty to determine who has su'd to root when committing, + based on a patch by Jakov Sosic. + * Add apparmor.d/cache/ to default ignores. + * Record real committer username in the darcs log, so that the man page + can say that for every VCS the username is recorded. + + -- Joey Hess <joeyh@debian.org> Thu, 18 Feb 2010 14:01:45 -0500 + +etckeeper (0.42) unstable; urgency=low + + * Deal with removal of the cache directory. Closes: #559418 + * Add ucf backups to ignore list. (See #462355) + * Add webmin fsdump status files to ignore list. Closes: #567000 + * Add *.old to ignore list (See #462355) + * Add *.elc to ignore list (See #491401) + * Add ntp.conf.dhcp and X11/xdm/authdir/authfiles/* to ignore list. + Closes: #491401 + * Fix handling of "#*#" ignores for git and hg. + * Add runit and daemontools supervise files to ignore list. + Closes: #529253 + + -- Joey Hess <joeyh@debian.org> Tue, 26 Jan 2010 16:20:38 -0500 + +etckeeper (0.41) unstable; urgency=low + + * Change etckeeper uninit to not remove .gitignore (etc) file + if it lacks the "managed by etckeeper" comment. Closes: #545137 + * Fix hgrc setup code to not warn if the hgrc already contains + a call to etckeeper. (Thanks, Jakov Sosic) + * Updated Czech debconf translation from Miroslav Kure. Closes: #546411 + + -- Joey Hess <joeyh@debian.org> Sat, 26 Sep 2009 15:58:15 -0400 + +etckeeper (0.40) unstable; urgency=low + + * Add Spanish debconf translation. Closes: #539589 + * Updated Italian debconf translation. Closes: #540516 + * Avoid infinite loop when displaying message about failure + to commit changes in /etc. Closes: #540596 + + -- Joey Hess <joeyh@debian.org> Sat, 08 Aug 2009 21:21:27 -0400 + +etckeeper (0.39) unstable; urgency=low + + * Document ETCKEEPER_CONF_DIR in man page. + * Typo. Closes: #536799 + * bzr: Set author to root when committing via sudo. Committer + will be the sudo user, as it is in git. + + -- Joey Hess <joeyh@debian.org> Fri, 31 Jul 2009 13:47:09 -0400 + +etckeeper (0.38) unstable; urgency=low + + * Use hostname if hostname -f fails. Closes: #533295 + * Automatically commit on initial install, so users can + begin relying on etckeeper right away. Closes: #533290 + + -- Joey Hess <joeyh@debian.org> Wed, 08 Jul 2009 14:40:58 -0400 + +etckeeper (0.37) unstable; urgency=low + + * Make postinst check for the configured VCS before trying to run + etckeeper init. Closes: #530497 + * Update French debconf translation. Closes: #530795 + * Fix typo in cruft file. Closes: #530819 + * Update Portuguese debconf translation. Closes: #528109 + * Update German debconf translation. Closes: #532346 + + -- Joey Hess <joeyh@debian.org> Mon, 08 Jun 2009 13:24:13 -0400 + +etckeeper (0.36) unstable; urgency=low + + * Add cruft ignore file. Closes: #522513 + * Update Japanese debconf translation. Closes: #527921 + * Update Swedish debconf translation. Closes: #528575 + * Update Russian debconf translation. Closes: #528798 + + -- Joey Hess <joeyh@debian.org> Sat, 16 May 2009 18:22:49 -0400 + +etckeeper (0.35) unstable; urgency=low + + * Make etckeeper uninit -f disable the prompt. + * Uninit on purge, guarded by a debconf prompt. Closes: #527218 + + -- Joey Hess <joeyh@debian.org> Wed, 06 May 2009 14:52:30 -0400 + +etckeeper (0.34) unstable; urgency=low + + * Add support for mktemp if tempfile is not available. + * Fix uninit prompt to accept 'y' as well as 'yes'. Closes: #517911 + * README: Typo. Closes: #517914 + + -- Joey Hess <joeyh@debian.org> Mon, 02 Mar 2009 17:01:09 -0500 + +etckeeper (0.33) unstable; urgency=low + + * Add support for yum. Thanks, Jimmy Tang. + + -- Joey Hess <joeyh@debian.org> Wed, 25 Feb 2009 14:38:12 -0500 + +etckeeper (0.32) unstable; urgency=low + + * Add uninit subcommand, which cleans up all etckeeper and VCS droppings + in /etc. This is useful if you want to switch to a different VCS and + don't have any history to preserve. (Preserving history and converting + is of course possible, but significantly harder.) + * Run etckeeper init on initial install. Closes: #505772 + (The idea being that if someone doesn't want to use git, they can + immediatly uninit to easily reverse this.) + * Document how to change the VCS used by etckeeper, without preserving + any history. Preserving history left as an exersise for the reader. + Closes: #515237 + * Implement list-installed for rpm. + * Added a spec file contributed by Jimmy Tang. + + -- Joey Hess <joeyh@debian.org> Tue, 24 Feb 2009 23:01:55 -0500 + +etckeeper (0.31) unstable; urgency=low + + * Avoid relying on USER being set, won't be for cron job. + Closes: #515602 + * Add .sw? to ignores. vim uses that if editing an + unspecified file name. Closes: #515628 + + -- Joey Hess <joeyh@debian.org> Mon, 16 Feb 2009 15:40:42 -0500 + +etckeeper (0.30) unstable; urgency=low + + * Add vim .*.sw? files to default ignores. + * Also add emacs #*# autosave files to default ignores. + * And DEADJOE files, for good measure. + * etckeeper update-ignore will automatically update the VCS ignore + file, only touching the part inside a "# managed by etckeeper" + comment block. (You may want to add such a comment block to your existing + .gitignore, or delete the file and regenerate it.) + * Run etckeeper update-ignore on upgrade. + * Fix handling of -d in recursive calls to etckeeper + + -- Joey Hess <joeyh@debian.org> Sat, 14 Feb 2009 01:21:22 -0500 + +etckeeper (0.29) unstable; urgency=low + + * Add a daily cron job to autocommit changes to /etc. Closes: #515100 + The cron job is enabled by default but can be disabled + via etckeeper.conf. + (Thanks to Thierry Carrez) + * Fix executable bits on two darcs support scripts. + + -- Joey Hess <joeyh@debian.org> Fri, 13 Feb 2009 13:43:02 -0500 + +etckeeper (0.28) unstable; urgency=low + + * Support darcs. Thanks to Gian Piero Carrubba. Closes: #510032 + + -- Joey Hess <joeyh@debian.org> Thu, 12 Feb 2009 17:13:23 -0500 + +etckeeper (0.27) unstable; urgency=low + + * Use SUDO_USER as the committer if set. Closes: #498739 + (Thierry Carrez) + * bzr: Avoid use of etckeeper pre-commit on Trees not on the + filesystem. (Jelmer Vernooij) + + -- Joey Hess <joeyh@debian.org> Sun, 01 Feb 2009 17:20:11 -0500 + +etckeeper (0.26) unstable; urgency=low + + * Add Japanese debconf translation. Closes: #512869 + * Prevent git from removing a directory when the last file in it + has been removed, but the directory is left existing and empty, + by touching a flag file before calling git rm. Closes: 513006 + + -- Joey Hess <joeyh@debian.org> Sun, 25 Jan 2009 13:55:56 -0500 + +etckeeper (0.25) unstable; urgency=low + + * Fix filter_unknown calls. Closes: 509888 + + -- Joey Hess <joeyh@debian.org> Wed, 31 Dec 2008 13:01:31 -0500 + +etckeeper (0.24) unstable; urgency=low + + * Make .etckeeper test that files actually exist + before acting on them. Closes: #509888 + + -- Joey Hess <joeyh@debian.org> Mon, 29 Dec 2008 15:37:25 -0500 + +etckeeper (0.23) unstable; urgency=low + + * Fix hook scripts to use new etckeeper path. Closes: #509742 + + -- Joey Hess <joeyh@debian.org> Thu, 25 Dec 2008 16:25:25 -0500 + +etckeeper (0.22) unstable; urgency=low + + * Move etckeeper to sbin, and man page to section 8, since only an admin + can really use etckeeper. Closes: #509152 + * Mention README file from man page. + * Build using python-central. For some reason bzr does not pick up on + plugins built using python-support. + + -- Joey Hess <joeyh@debian.org> Tue, 23 Dec 2008 18:51:14 -0500 etckeeper (0.21) unstable; urgency=low diff --git a/debian/control b/debian/control index 7a956ee..c578d82 100644 --- a/debian/control +++ b/debian/control @@ -1,22 +1,25 @@ Source: etckeeper Section: admin Priority: optional -Build-Depends: debhelper (>= 7), dpkg-dev (>= 1.9.0), bzr (>= 1.4~), python-support (>= 0.5.3) +Build-Depends: debhelper (>= 7), dpkg-dev (>= 1.9.0), bzr (>= 1.5~), python Maintainer: Joey Hess <joeyh@debian.org> -Standards-Version: 3.8.0 +Standards-Version: 3.9.2 +XS-Python-Version: all Vcs-Git: git://git.kitenet.net/etckeeper Homepage: http://kitenet.net/~joey/code/etckeeper/ Package: etckeeper Architecture: all Section: admin -Depends: git-core (>= 1:1.6.0) | mercurial | bzr (>= 1.4~), ${misc:Depends} -Conflicts: bzr (<< 1.4~) -Description: store /etc in git, mercurial, or bzr +Depends: git (>= 1:1.7) | mercurial | bzr (>= 1.5~) | darcs, ${misc:Depends} +Recommends: cron +Suggests: sudo (>= 1.7.4p4) +Conflicts: bzr (<< 1.5~) +Description: store /etc in git, mercurial, bzr or darcs The etckeeper program is a tool to let /etc be stored in a git, mercurial, - or bzr repository. It hooks into APT to automatically commit changes made to - /etc during package upgrades. It tracks file metadata that - 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. + bzr or darcs repository. It hooks into APT to automatically commit changes + made to /etc during package upgrades. It tracks file metadata that 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/copyright b/debian/copyright index 36a8d76..6b87dc1 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,5 +1,7 @@ +Format: http://dep.debian.net/deps/dep5/ + Files: * -Copyright: © 2007-2008 Joey Hess <joey@kitenet.net> +Copyright: © 2007-2011 Joey Hess <joey@kitenet.net> License: GPL-2+ The full text of the GPL is distributed as doc/GPL in etckeeper's source, and is distributed in /usr/share/common-licenses/GPL-2 on Debian systems. diff --git a/debian/cron.daily b/debian/cron.daily new file mode 100644 index 0000000..b46e7a2 --- /dev/null +++ b/debian/cron.daily @@ -0,0 +1,15 @@ +#!/bin/sh +set -e +if [ -x /usr/bin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then + . /etc/etckeeper/etckeeper.conf + if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then + # avoid autocommit if an install run is in progress + if [ ! -e /var/cache/etckeeper/packagelist.pre-install ]; then + AVOID_SPECIAL_FILE_WARNING=1 + export AVOID_SPECIAL_FILE_WARNING + if etckeeper unclean; then + etckeeper commit "daily autocommit" >/dev/null + fi + fi + fi +fi diff --git a/debian/po/cs.po b/debian/po/cs.po index 6982576..b7d7c54 100644 --- a/debian/po/cs.po +++ b/debian/po/cs.po @@ -1,14 +1,14 @@ # Czech translation of etckeeper debconf messages. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the etckeeper package. -# Miroslav Kure <kurem@debian.cz>, 2007 +# Miroslav Kure <kurem@debian.cz>, 2007,2009 # msgid "" msgstr "" "Project-Id-Version: etckeeper\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" -"PO-Revision-Date: 2007-12-24 13:10+0100\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2009-09-13 09:09+0200\n" "Last-Translator: Miroslav Kure <kurem@debian.cz>\n" "Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n" "MIME-Version: 1.0\n" @@ -36,6 +36,24 @@ msgid "" msgstr "" "Před pokračováním byste měli ručně vyřešit problémy s nezapsanými změnami." +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "Odstranit ${VCS} repositář etckeeperu a přidružené soubory?" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" +"Etckeeper se na tomto systému používal pro uchování /etc v ${VCS} " +"repositáři, avšak nyní je ze systému odstraňován. Pokud povolíte odstranění " +"repositáře, ZNIČÍTE tím veškerou historii, kterou etckeeper uchovával." + #~ msgid "Commit changed files in /etc to ${VCS}?" #~ msgstr "Zapsat změněné soubory v /etc do ${VCS}?" diff --git a/debian/po/da.po b/debian/po/da.po new file mode 100644 index 0000000..48bae8d --- /dev/null +++ b/debian/po/da.po @@ -0,0 +1,57 @@ +# Danish translation etckeeper. +# Copyright (C) 2010 etckeeper & nedenst??ende overs??ttere. +# This file is distributed under the same license as the etckeeper package. +# Joe Hansen <joedalton2@yahoo.dk>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: etckeeper\n" +"Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2010-09-22 17:30+01:00\n" +"Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n" +"Language-Team: Danish <debian-l10n-danish@lists.debian.org> \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: error +#. Description +#: ../templates:2001 +msgid "Commit failed" +msgstr "Indsendelse (commit) mislykkedes" + +#. Type: error +#. Description +#: ../templates:2001 +msgid "An attempt to commit /etc changes to ${VCS} failed." +msgstr "Et fors??g p?? at indsende (commit) /etc-??ndringer til ${VCS} mislykkedes." + +#. Type: error +#. Description +#: ../templates:2001 +msgid "" +"You may manually resolve the issues with the uncommitted changes before " +"continuing." +msgstr "" +"Du skal manuelt l??se problemstillingerne med de ikke indsendte (uncommitted) " +"??ndringer, f??r du forts??tter." + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "Fjern etckeeper ${VCS}-arkiv og associerede filer?" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" +"Etckeeper afinstalleres fra systemet, og blev brugt til at gemme /etc i et " +"${VCS}-arkiv. Hvis du v??lger at fjerne arkivet, vil dette ??DEL??GGE al historik " +"som etckeeper har optaget for /etc." + diff --git a/debian/po/de.po b/debian/po/de.po index 170630f..069ff84 100644 --- a/debian/po/de.po +++ b/debian/po/de.po @@ -1,13 +1,13 @@ # Translation of etckeeper debconf templates to German -# Copyright (C) Helge Kreutzmann <debian@helgefjell.de>, 2008. +# Copyright (C) Helge Kreutzmann <debian@helgefjell.de>, 2008, 2009. # This file is distributed under the same license as the etckeeper package. # msgid "" msgstr "" "Project-Id-Version: etckeeper 0.10\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" -"PO-Revision-Date: 2008-01-29 21:41+0100\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2009-06-08 19:05+0200\n" "Last-Translator: Helge Kreutzmann <debian@helgefjell.de>\n" "Language-Team: de <debian-l10n-german@lists.debian.org>\n" "MIME-Version: 1.0\n" @@ -37,6 +37,25 @@ msgstr "" "Sie knnen das Problem mit den nicht-bergebenen nderungen manuell beheben, " "bevor Sie fortfahren." +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "Das ${VCS}-Depot von Etckeeper und die zugehrigen Dateien entfernen?" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" +"Etckeeper wurde zum Speichern von /etc in einem ${VCS}-Depot verwandt und " +"wird jetzt vollstndig vom System gelscht. Falls Sie entscheiden, das Depot " +"zu entfernen, wird dies den Verlauf, den Etckeeper fr /etc aufgezeichnet " +"hat, ZERSTREN." + #~ msgid "Commit changed files in /etc to ${VCS}?" #~ msgstr "Genderte Dateien in /etc an ${VCS} bergeben?" diff --git a/debian/po/es.po b/debian/po/es.po new file mode 100644 index 0000000..441cfbd --- /dev/null +++ b/debian/po/es.po @@ -0,0 +1,85 @@ +# etckeeper po-debconf translation to Spanish. +# Copyright (C) 2009 Software in the Public Interest. +# This file is distributed under the same license as the etckeeper package. +# +# Changes: +# - Initial translation +# Fernando González de Requena <fgrequena@gmail.com>, 2009. +# +# +# Traductores, si no conoce el formato PO, merece la pena leer la +# documentación de gettext, especialmente las secciones dedicadas a este +# formato, por ejemplo ejecutando: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Equipo de traducción al español, por favor lean antes de traducir +# los siguientes documentos: +# +# - El proyecto de traducción de Debian al español +# http://www.debian.org/intl/spanish/ +# especialmente las notas y normas de traducción en +# http://www.debian.org/intl/spanish/notas +# +# - La guía de traducción de po's de debconf: +# /usr/share/doc/po-debconf/README-trans +# o http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Si tiene dudas o consultas sobre esta traducción consulte con el último +# traductor (campo Last-Translator) y ponga en copia a la lista de +# traducción de Debian al español (<debian-l10n-spanish@lists.debian.org>) +# +msgid "" +msgstr "" +"Project-Id-Version: etckeeper 0.38\n" +"Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2009-07-11 16:07+0200\n" +"Last-Translator: Fernando González de Requena <fgrequena@gmail.com>\n" +"Language-Team: Spanish <debian-l10n-spanish@lists.debian.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: error +#. Description +#: ../templates:2001 +msgid "Commit failed" +msgstr "El envío de los cambios ha fallado" + +#. Type: error +#. Description +#: ../templates:2001 +msgid "An attempt to commit /etc changes to ${VCS} failed." +msgstr "Ha fallado un intento de enviar los cambios en «/etc» a ${VCS}." + +#. Type: error +#. Description +#: ../templates:2001 +msgid "" +"You may manually resolve the issues with the uncommitted changes before " +"continuing." +msgstr "" +"Puede resolver manualmente los problemas con los cambios que no se han enviado " +"antes de continuar." + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "¿Desea eliminar el repositorio ${VCS} de etckeeper y los ficheros asociados?" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" +"Se está eliminando completamente etckeeper de su sistema. Etckeeper se ha " +"utilizado para almacenar el directorio «/etc» en un repositorio ${VCS}. Si elige " +"eliminar el repositorio, se DESTRUIRÁ todo el historial que etckeeper ha " +"guardado para «/etc»." + diff --git a/debian/po/eu.po b/debian/po/eu.po index 8cdae6c..9f5ceba 100644 --- a/debian/po/eu.po +++ b/debian/po/eu.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: etckeeper-eu\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" "PO-Revision-Date: 2007-12-17 12:47+0100\n" "Last-Translator: Aitor Ibañez <aitiba@gmail.com>\n" "Language-Team: Euskara <Librezale@librezale.org>\n" @@ -40,6 +40,21 @@ msgstr "" "Aurrera jarraitu baino lehen, eskuz erresolbitu beharko ditu onartu gabeko " "aldaketak." +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" + #~ msgid "Commit changed files in /etc to ${VCS}?" #~ msgstr "Aldaturiko fitxategiak ${VCS}-en onartu?" diff --git a/debian/po/fi.po b/debian/po/fi.po index c6fbcde..51204bc 100644 --- a/debian/po/fi.po +++ b/debian/po/fi.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: etckeeper 0.3\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" "PO-Revision-Date: 2007-12-12 19:54+0200\n" "Last-Translator: Esko Arajärvi <edu@iki.fi>\n" "Language-Team: Finnish <debian-l10n-finnish@lists.debian.org>\n" @@ -33,6 +33,21 @@ msgid "" msgstr "" "Voit selvittää tallettamattomien muutosten ongelmat käsin ennen jatkamista." +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" + #~ msgid "Commit changed files in /etc to ${VCS}?" #~ msgstr "Talletetaanko hakemiston /etc muutetut tiedostot ${VCS}in?" diff --git a/debian/po/fr.po b/debian/po/fr.po index e8e0ec1..d4125fa 100644 --- a/debian/po/fr.po +++ b/debian/po/fr.po @@ -1,22 +1,24 @@ -# Translation of etckeeper debconf templates to French -# Copyright (C) 2007 Jean-Baka Domelevo Entfellner <domelevo@gmail.com> +# Translation of etckeeper debconf template to French +# Copyright (C) 2009 Debian French l10n team <debian-l10n-french@lists.debian.org> # This file is distributed under the same license as the etckeeper package. # +# Translators: # Jean-Baka Domelevo Entfellner <domelevo@gmail.com>, 2007. -# +# Bruno Travouillon <debian@travouillon.fr>, 2009. msgid "" msgstr "" "Project-Id-Version: etckeeper\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" -"PO-Revision-Date: 2007-12-12 08:28+0100\n" -"Last-Translator: Jean-Baka Domelevo Entfellner <domelevo@gmail.com>\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2009-05-17 11:42+0200\n" +"Last-Translator: Bruno Travouillon <debian@travouillon.fr>\n" "Language-Team: French <debian-l10n-french@lists.debian.org>\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: French\n" "X-Poedit-Country: FRANCE\n" +"X-Generator: KBabel 1.11.4\n" #. Type: error #. Description @@ -29,7 +31,8 @@ msgstr "Échec de la synchronisation" #: ../templates:2001 msgid "An attempt to commit /etc changes to ${VCS} failed." msgstr "" -"La tentative d'enregistrement des modifications de /etc vers ${VCS} a échoué." +"La tentative d'enregistrement (« commit ») des modifications de /etc vers " +"${VCS} a échoué." #. Type: error #. Description @@ -41,18 +44,22 @@ msgstr "" "Avant de poursuivre, vous devriez résoudre vous-même les problèmes liés aux " "changements non sauvegardés." -#~ msgid "Commit changed files in /etc to ${VCS}?" -#~ msgstr "" -#~ "Faut-il enregistrer dans ${VCS} les modifications de fichiers faites " -#~ "dans /etc ?" +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "" +"Faut-il supprimer le référentiel ${VCS} d'etckeeper et les fichiers " +"associés ?" -#~ msgid "" -#~ "The /etc directory contains uncommitted files or other changes. It's best " -#~ "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 ${VCS} avant de lancer APT. Les ajouts " -#~ "et modifications de fichiers dont la liste suit peuvent être enregistrés " -#~ "automatiquement :" +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" +"Etckeeper est purgé du système, et était utilisé pour stocker /etc dans un " +"référentiel ${VCS}. Si vous choisissez de supprimer ce référentiel, cela va " +"DÉTRUIRE tout l'historique qu'etckeeper a enregistré pour /etc." diff --git a/debian/po/gl.po b/debian/po/gl.po index fe33fcb..937ccca 100644 --- a/debian/po/gl.po +++ b/debian/po/gl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: etckeeper\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" "PO-Revision-Date: 2007-12-11 20:52+0000\n" "Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n" "Language-Team: Galician <proxecto@trasno.net>\n" @@ -34,6 +34,21 @@ msgid "" "continuing." msgstr "configurar apt para que instale paquetes adicionais do CD.<" +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" + #~ msgid "Commit changed files in /etc to ${VCS}?" #~ msgstr "¿Gardar en ${VCS} os ficheiros modificados de /etc?" diff --git a/debian/po/it.po b/debian/po/it.po index 80a4b3f..b3b44aa 100644 --- a/debian/po/it.po +++ b/debian/po/it.po @@ -1,14 +1,14 @@ # Italian (it) translation of debconf templates for etckeeper # Copyright (C) 2007 Software in the Public Interest # This file is distributed under the same license as the etckeeper package. -# Luca Monducci <luca.mo@tiscali.it>, 2007. +# Luca Monducci <luca.mo@tiscali.it>, 2007-2009. # msgid "" msgstr "" -"Project-Id-Version: etckeeper 0.3 debconf templates\n" +"Project-Id-Version: etckeeper 0.36 debconf templates\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" -"PO-Revision-Date: 2007-12-14 20:32+0100\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2009-08-08 15:32+0200\n" "Last-Translator: Luca Monducci <luca.mo@tiscali.it>\n" "Language-Team: Italian <debian-l10n-italian@lists.debian.org>\n" "MIME-Version: 1.0\n" @@ -34,18 +34,24 @@ msgid "" "You may manually resolve the issues with the uncommitted changes before " "continuing." msgstr "" -"Potrebbe essere necessario risolvere i problemi con le modifiche delle quali " -"non è stato fatto il commit prima di continuare." +"Potrebbe essere necessario risolvere manualmente i problemi con le modifiche " +"delle quali non è stato fatto il commit prima di continuare." -#~ msgid "Commit changed files in /etc to ${VCS}?" -#~ msgstr "Commit dei file modificati in /etc a ${VCS}?" +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "Eliminare il repository ${VCS} di etckeeper e i file associati?" -#~ msgid "" -#~ "The /etc directory contains uncommitted files or other changes. It's best " -#~ "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 ${VCS} prima di eseguire APT. È possibile fare " -#~ "automaticamente il commit dei file nuovi o modificati elencati in seguito:" +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" +"Etckeeper sta per essere completamente rimosso dal sistema, è stato usato " +"per memorizzare il contenuto di /etc in un repository ${VCS}. Nel caso si " +"scelga di eliminare il repository, si DISTRUGGE tutta la storia di /etc " +"registrata da etckeeper." diff --git a/debian/po/ja.po b/debian/po/ja.po new file mode 100644 index 0000000..6b6c2f1 --- /dev/null +++ b/debian/po/ja.po @@ -0,0 +1,56 @@ +# Copyright (C) 2008-2009 Joey Hess <joeyh@debian.org> +# This file is distributed under the same license as etckeeper package. +# Hideki Yamane (Debian-JP) <henrich@debian.or.jp>, 2008-2009. +# +msgid "" +msgstr "" +"Project-Id-Version: etckeeper 0.35\n" +"Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2009-05-09 19:26+0900\n" +"Last-Translator: Hideki Yamane (Debian-JP) <henrich@debian.or.jp>\n" +"Language-Team: Japanese <debian-japanese@lists.debian.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: error +#. Description +#: ../templates:2001 +msgid "Commit failed" +msgstr "コミットに失敗しました" + +#. Type: error +#. Description +#: ../templates:2001 +msgid "An attempt to commit /etc changes to ${VCS} failed." +msgstr "/etc の変更を ${VCS} にコミットしようとしましたが失敗しました。" + +#. Type: error +#. Description +#: ../templates:2001 +msgid "" +"You may manually resolve the issues with the uncommitted changes before " +"continuing." +msgstr "" +"続ける前に、この問題とコミットされていない変更について、手動で解決する必要が" +"あるでしょう。" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "etckeeper の$ {VCS} リポジトリおよび関連ファイルを削除しますか?" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" +"Etckeeper はシステムから完全に削除されようとしており、/etc の保存には ${VCS} " +"リポジトリを利用していました。リポジトリを削除すると、/etc について etckeeper " +"が記録してた全ての履歴は「破壊」されます。" + diff --git a/debian/po/nl.po b/debian/po/nl.po index a4dd509..75115fe 100644 --- a/debian/po/nl.po +++ b/debian/po/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: etckeeper\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" "PO-Revision-Date: 2008-01-01 21:21+0100\n" "Last-Translator: Bart Cornelis <cobaco@skolelinux.no>\n" "Language-Team: debian-l10n-dutch <debian-l10n-dutch@lists.debian.org>\n" @@ -39,6 +39,21 @@ msgstr "" "U kunt de problemen met de niet-vastgelegde aanpassingen handmatig oplossen " "alvorens verder te gaan." +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" + #~ msgid "Commit changed files in /etc to ${VCS}?" #~ msgstr "Wilt u aangepaste bestanden uit de map '/etc' vastleggen in ${VCS}?" diff --git a/debian/po/pl.po b/debian/po/pl.po new file mode 100644 index 0000000..406f5eb --- /dev/null +++ b/debian/po/pl.po @@ -0,0 +1,47 @@ +# Polish translation +# Copyright (C) 2010 +# This file is distributed under the same license as the etckeeper package. +# Artur R. Czechowski <arturcz@hell.pl>, 2010 +# +msgid "" +msgstr "" +"Project-Id-Version: etckeeper 0.50\n" +"Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2010-12-19 20:07+0100\n" +"Last-Translator: Artur R. Czechowski <arturcz@hell.pl>\n" +"Language-Team: Polish <debian-l10n-polish@lists.debian.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: error +#. Description +#: ../templates:2001 +msgid "Commit failed" +msgstr "Błąd zapisu." + +#. Type: error +#. Description +#: ../templates:2001 +msgid "An attempt to commit /etc changes to ${VCS} failed." +msgstr "Nieudana próba zapisania zmian przy użyciu ${VCS}" + +#. Type: error +#. Description +#: ../templates:2001 +msgid "You may manually resolve the issues with the uncommitted changes before continuing." +msgstr "Przed kontynuacją możesz ręcznie rozwiązać problemy z niezapisanymi zmianami." + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "Usunąć repozytorium etckeeper ${VCS} i powiązane pliki?" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Etckeeper is being purged from the system, and was used to store /etc in a ${VCS} repository. If you choose to remove the repository, this will DESTROY all history etckeeper has recorded for /etc." +msgstr "Etckeeper jest usuwany z systemu, ale był używany do przechowywania zawartości katalogu /etc w repozytorium ${VCS}. Jeśli wybierzesz usunięcie repozytorium, historia zmian zapisana dla katalogu /etc zostanie BEZPOWROTNIE USUNIĘTA." + diff --git a/debian/po/pt.po b/debian/po/pt.po index de1feeb..cac10cf 100644 --- a/debian/po/pt.po +++ b/debian/po/pt.po @@ -1,14 +1,14 @@ # translation of etckeeper debconf to Portuguese -# Copyright (C) 2007 Américo Monteiro +# Copyright (C) 2007 the etckeeper's copyright holder # This file is distributed under the same license as the etckeeper package. # -# Américo Monteiro <a_monteiro@netcabo.pt>, 2007. +# Américo Monteiro <a_monteiro@netcabo.pt>, 2007, 2009. msgid "" msgstr "" -"Project-Id-Version: etckeeper 0.3\n" +"Project-Id-Version: etckeeper 0.35\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" -"PO-Revision-Date: 2007-12-11 20:01+0000\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2009-05-10 22:10+0100\n" "Last-Translator: Américo Monteiro <a_monteiro@netcabo.pt>\n" "Language-Team: Portuguese <traduz@debianpt.org>\n" "MIME-Version: 1.0\n" @@ -20,7 +20,7 @@ msgstr "" #. Description #: ../templates:2001 msgid "Commit failed" -msgstr "Submissão falhada" +msgstr "Submissão falhou" #. Type: error #. Description @@ -38,15 +38,21 @@ msgstr "" "Você pode resolver manualmente as situações com as alterações não submetidas " "antes de continuar. " -#~ msgid "Commit changed files in /etc to ${VCS}?" -#~ msgstr "Submeter ficheiros alterados em /etc para o ${VCS}?" +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "Remover o repositório ${VCS} do etckeeper e os ficheiros associados?" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" +"O etckeeper está a ser purgado do sistema, e foi usado para guardar o /etc num " +"repositório ${VCS}. Se escolher remover o repositório, isto irá DESTRUIR todo " +"o histórico que o etckeeper guardou de /etc." -#~ msgid "" -#~ "The /etc directory contains uncommitted files or other changes. It's best " -#~ "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 ${VCS} antes de " -#~ "correr o APT. Os ficheiros adicionados e alterados da lista em baixo " -#~ "podem ser submetidos automaticamente:" diff --git a/debian/po/ru.po b/debian/po/ru.po index 5776848..b72b888 100644 --- a/debian/po/ru.po +++ b/debian/po/ru.po @@ -3,20 +3,20 @@ # This file is distributed under the same license as the PACKAGE package. # # Yuri Kozlov <kozlov.y@gmail.com>, 2007. +# Yuri Kozlov <yuray@komyakino.ru>, 2009. msgid "" msgstr "" -"Project-Id-Version: 0.3\n" +"Project-Id-Version: etckeeper 0.35\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" -"PO-Revision-Date: 2007-12-12 21:23+0300\n" -"Last-Translator: Yuri Kozlov <kozlov.y@gmail.com>\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2009-05-15 21:25+0400\n" +"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n" "Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" -"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #. Type: error #. Description @@ -37,18 +37,24 @@ msgid "" "You may manually resolve the issues with the uncommitted changes before " "continuing." msgstr "" -"Перед тем как продолжить вы можете исправить это вручную через " -"незафиксированные изменения." +"Перед тем как продолжить вы можете вручную исправить положение " +"с незафиксированными изменениями." -#~ msgid "Commit changed files in /etc to ${VCS}?" -#~ msgstr "Зафиксировать изменённые файлы /etc в ${VCS}?" +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "Удалить репозиторий etckeeper ${VCS} и связанные с ним файлы?" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" +"Etckeeper вычищается из системы, но использовался для хранения каталога " +"/etc в репозитории ${VCS}. Если вы выберете удаление репозитория, то " +"это УНИЧТОЖИТ всю историю, которую etckeeper вёл для /etc." -#~ msgid "" -#~ "The /etc directory contains uncommitted files or other changes. It's best " -#~ "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 в ${VCS}. Перечисленные " -#~ "ниже добавленные и изменённые файлы могут быть зафиксированы " -#~ "автоматически:" diff --git a/debian/po/sv.po b/debian/po/sv.po index e1f5025..c40476d 100644 --- a/debian/po/sv.po +++ b/debian/po/sv.po @@ -8,15 +8,15 @@ msgid "" msgstr "" "Project-Id-Version: etckeeper_0.20_sv\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" -"PO-Revision-Date: 2008-07-17 17:25+0200\n" -"Last-Translator: Martin Ågren <martin.agren@gmail.com>\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2009-05-12 20:08+0100\n" +"Last-Translator: Martin Bagge <brother@bsnet.se>\n" "Language-Team: Swedish <debian-l10n-swedish@lists.debian.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. Type: error #. Description @@ -37,6 +37,23 @@ msgid "" "You may manually resolve the issues with the uncommitted changes before " "continuing." msgstr "" -"Du kan lösa problemen med de overkställda ändringarna manuellt innan " -"du fortsätter." +"Du kan lösa problemen med de overkställda ändringarna manuellt innan du " +"fortsätter." +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "Ska ${VCS}-förrådet för etckeeper och alla tillhörande filer tas bort?" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" +"Etckeeper håller på att tas bort från systemet, användningsområdet för " +"etckeeper är att spara /etc i ett ${VCS}-förråd. Om du väljer att ta bort " +"förrådet kommer all historik för /etc att raderas." diff --git a/debian/po/templates.pot b/debian/po/templates.pot index e5472e3..93e0fdd 100644 --- a/debian/po/templates.pot +++ b/debian/po/templates.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -35,3 +35,18 @@ msgid "" "You may manually resolve the issues with the uncommitted changes before " "continuing." msgstr "" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "" + +#. Type: boolean +#. Description +#: ../templates:3001 +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "" diff --git a/debian/po/vi.po b/debian/po/vi.po index 779a239..4a75241 100644 --- a/debian/po/vi.po +++ b/debian/po/vi.po @@ -1,61 +1,54 @@ # Vietnamese translation for ETC Keeper. -# Copyright © 2007 Free Software Foundation, Inc. -# Clytie Siddall <clytie@riverland.net.au>, 2007 +# Copyright © 2010 Free Software Foundation, Inc. +# Clytie Siddall <clytie@riverland.net.au>, 2007-2010. # msgid "" msgstr "" -"Project-Id-Version: etckeeper 0.3\n" +"Project-Id-Version: etckeeper 0.50\n" "Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n" -"POT-Creation-Date: 2008-03-14 01:55-0400\n" -"PO-Revision-Date: 2007-12-21 22:43+1030\n" +"POT-Creation-Date: 2009-05-06 14:41-0400\n" +"PO-Revision-Date: 2010-10-31 13:59+1030\n" "Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n" "Language-Team: Vietnamese <vi-VN@googlegroups.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: LocFactoryEditor 1.7b1\n" +"X-Generator: LocFactoryEditor 1.8\n" +#: ../templates:2001 #. Type: error #. Description -#: ../templates:2001 msgid "Commit failed" msgstr "Lỗi ghi chép" +#: ../templates:2001 #. Type: error #. Description -#: ../templates:2001 -#, fuzzy #| msgid "An attempt to commit /etc changes to git failed." msgid "An attempt to commit /etc changes to ${VCS} failed." -msgstr "Gặp lỗi khi thử ghi vào git các thay đổi trong « /etc »." +msgstr "Gặp lỗi khi thử ghi chép vào ${VCS} các thay đổi trong « /etc »." +#: ../templates:2001 #. Type: error #. Description -#: ../templates:2001 msgid "" "You may manually resolve the issues with the uncommitted changes before " "continuing." msgstr "" -"Bạn vẫn có thể tự giải quyết các vấn đề về các thay đổi chưa ghi chép, trước " -"khi tiếp tục." +"Bạn cũng có thể tự giải quyết vấn đề về các thay đổi chưa ghi chép, trước khi tiếp tục." -#, fuzzy -#~| msgid "Commit changed files in /etc to git?" -#~ msgid "Commit changed files in /etc to ${VCS}?" -#~ msgstr "Ghi vào git các tập tin bị thay đổi trong « /etc » không?" +#: ../templates:3001 +#. Type: boolean +#. Description +msgid "Remove etckeeper ${VCS} repository and associated files?" +msgstr "Gỡ bỏ kho lưu ${VCS} etckeeper và các tập tin tương ứng ?" -#, fuzzy -#~| 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 changed files listed below can be committed automatically:" -#~ msgid "" -#~ "The /etc directory contains uncommitted files or other changes. It's best " -#~ "for all files in /etc to be committed to ${VCS} before running APT. Added " -#~ "and changed files listed below can be committed automatically:" -#~ msgstr "" -#~ "Thư mục « /etc » chứa các tập tin hay thay đổi khác mà chưa ghi chép. Tốt " -#~ "nhất nếu mọi tập tin trong « /etc » được ghi chép, trước khi chạy APT. Có " -#~ "thể tự động ghi chép các tập tin được thêm và bị thay đổi trong danh sách " -#~ "bên dưới:" +#: ../templates:3001 +#. Type: boolean +#. Description +msgid "" +"Etckeeper is being purged from the system, and was used to store /etc in a " +"${VCS} repository. If you choose to remove the repository, this will DESTROY " +"all history etckeeper has recorded for /etc." +msgstr "Gói etckeeper đang bị tẩy khỏi hệ thống: nó từng được sử dụng để lưu trữ « /etc » vào một kho ${VCS}. Sự chọn gỡ bỏ kho lưu này thì HỦY toàn bộ lịch sử được etckeeper giữ đối với « /etc »." diff --git a/debian/postinst b/debian/postinst index e4fb0b3..496a5d8 100644 --- a/debian/postinst +++ b/debian/postinst @@ -65,4 +65,30 @@ configure) mv_conffile "/etc/etckeeper/init.d/20restore-metadata" \ "/etc/etckeeper/init.d/10restore-metadata" fi + if dpkg --compare-versions "$2" le "0.28"; then + for c in commit.d/30darcs-add init.d/60darcs-deleted-symlinks; do + if [ -e /etc/etckeeper/$c ]; then + chmod +x /etc/etckeeper/$c + fi + done + fi + + if [ "$2" = "" ] && [ -e "/etc/etckeeper/etckeeper.conf" ]; then + # Fresh install. + . /etc/etckeeper/etckeeper.conf || true + if [ -n "$VCS" ] && [ -x "`which $VCS 2>/dev/null`" ]; then + if etckeeper init; then + if ! etckeeper commit "Initial commit"; then + echo "etckeeper commit failed; run it by hand" >&2 + fi + else + echo "etckeeper init failed; run it by hand" >&2 + fi + else + echo "etckeeper init not ran as $VCS is not installed" >&2 + fi + fi + + # prints error and exits nonzero if the ignore file cannot be updated + etckeeper update-ignore || true esac diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..7fd06f6 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,31 @@ +#!/bin/sh +set -e + +if [ "$1" = purge ]; then + if [ -e /etc/.etckeeper ]; then + . /usr/share/debconf/confmodule + + # uninit on purge is tricky because etckeeper's configuration + # and code has been removed at this point. This relies on a + # stashed away copy. + if [ -e /var/cache/etckeeper/stash/etckeeper.conf ] && + [ -d /var/cache/etckeeper/stash/uninit.d ] && + [ -x /var/cache/etckeeper/stash/etckeeper ]; then + . /var/cache/etckeeper/stash/etckeeper.conf + if [ -n "$VCS" ]; then + db_subst etckeeper/purge VCS "$VCS" + db_input critical etckeeper/purge || true + db_go || true + db_get etckeeper/purge + if [ "$RET" = true ]; then + ETCKEEPER_CONF_DIR=/var/cache/etckeeper/stash + export ETCKEEPER_CONF_DIR + /var/cache/etckeeper/stash/etckeeper uninit -f || true + fi + fi + fi + fi + rm -rf /var/cache/etckeeper +fi + +#DEBHELPER# diff --git a/debian/preinst b/debian/preinst index b4495fe..a510cef 100644 --- a/debian/preinst +++ b/debian/preinst @@ -69,4 +69,17 @@ install|upgrade) rm_conffile etckeeper "/etc/etckeeper/commit.d/$c" done fi + if dpkg --compare-versions "$2" le "0.50"; then + for c in 20warn-hardlinks 20warn-special-file; do + rm_conffile etckeeper "/etc/etckeeper/pre-commit.d/$c" + done + fi + if dpkg --compare-versions "$2" le "0.58"; then + for c in commit.d/40git-rm; do + rm_conffile etckeeper "/etc/etckeeper/pre-commit.d/$c" + done + fi + + # delete files the prerm stashes away to handle purging + rm -rf /var/cache/etckeeper/stash esac diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..e13f086 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,19 @@ +#!/bin/sh +set -e + +#DEBHELPER# + +if [ "$1" = remove ]; then + # In case etckeeper is being purged, stash away a copy of + # the files purging will need. + mkdir -p /var/cache/etckeeper/stash + if [ -e /etc/etckeeper/etckeeper.conf ]; then + cp -a /etc/etckeeper/etckeeper.conf /var/cache/etckeeper/stash + fi + if [ -d /etc/etckeeper/uninit.d ]; then + cp -a /etc/etckeeper/uninit.d /var/cache/etckeeper/stash + fi + if [ -x /usr/bin/etckeeper ]; then + cp -a /usr/bin/etckeeper /var/cache/etckeeper/stash + fi +fi diff --git a/debian/rules b/debian/rules index 4fe53ed..b6b9b90 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,9 @@ #!/usr/bin/make -f + +export PYTHON_INSTALL_OPTS=--install-layout=deb + %: - dh $@ + dh --with python2 $@ # Not intended for use by anyone except the author. announcedir: diff --git a/debian/templates b/debian/templates index 660d594..2cec92c 100644 --- a/debian/templates +++ b/debian/templates @@ -14,3 +14,12 @@ _Description: Commit failed . You may manually resolve the issues with the uncommitted changes before continuing. + +Template: etckeeper/purge +Type: boolean +Default: true +_Description: Remove etckeeper ${VCS} repository and associated files? + Etckeeper is being purged from the system, and was used to + store /etc in a ${VCS} repository. If you choose to remove the + repository, this will DESTROY all history etckeeper has recorded + for /etc. @@ -1,6 +1,11 @@ #!/bin/sh set -e -conf=/etc/etckeeper/etckeeper.conf + +if [ -z "$ETCKEEPER_CONF_DIR" ]; then + ETCKEEPER_CONF_DIR=/etc/etckeeper +fi + +conf="$ETCKEEPER_CONF_DIR/etckeeper.conf" usage() { echo "usage: etckeeper command [-d directory]" >&2 @@ -17,6 +22,12 @@ if [ -z "$VCS" ]; then fi export VCS +program_directory="${0%/*}" +if [ -n "$program_directory" ]; then + PATH="$PATH:$program_directory" + export PATH +fi + if [ ! -z "$GIT_COMMIT_OPTIONS" ]; then export GIT_COMMIT_OPTIONS fi @@ -26,6 +37,9 @@ fi if [ ! -z "$BZR_COMMIT_OPTIONS" ]; then export BZR_COMMIT_OPTIONS fi +if [ ! -z "$DARCS_COMMIT_OPTIONS" ]; then + export DARCS_COMMIT_OPTIONS +fi if [ ! -z "$HIGHLEVEL_PACKAGE_MANAGER" ]; then export HIGHLEVEL_PACKAGE_MANAGER @@ -36,6 +50,9 @@ fi if [ ! -z "$AVOID_COMMIT_BEFORE_INSTALL" ]; then export AVOID_COMMIT_BEFORE_INSTALL fi +if [ ! -z "$AVOID_SPECIAL_FILE_WARNING" ]; then + export AVOID_SPECIAL_FILE_WARNING +fi if [ -z "$1" ]; then usage @@ -50,22 +67,26 @@ elif [ "$command" = "pre-apt" ]; then command=pre-install fi -if [ ! -d "/etc/etckeeper/$command.d" ]; then - echo "etckeeper: /etc/etckeeper/$command.d does not exist" >&2 +if [ ! -d "$ETCKEEPER_CONF_DIR/$command.d" ]; then + echo "etckeeper: $ETCKEEPER_CONF_DIR/$command.d does not exist" >&2 exit 1 fi if [ "x$1" = "x-d" ]; then if [ -n "$2" ]; then - cd "$2" + ETCKEEPER_DIR="$2" shift 2 else usage fi -else - cd /etc fi +if [ -z "$ETCKEEPER_DIR" ]; then + ETCKEEPER_DIR=/etc +fi +cd "$ETCKEEPER_DIR" +export ETCKEEPER_DIR + lsscripts() { perl -e ' $dir=shift; @@ -75,6 +96,6 @@ lsscripts() { ' "$1" } -for script in $(lsscripts "/etc/etckeeper/$command.d"); do +for script in $(lsscripts "$ETCKEEPER_CONF_DIR/$command.d"); do "$script" "$@" done diff --git a/etckeeper-bzr/__init__.py b/etckeeper-bzr/__init__.py index 54d160d..61322fe 100755 --- a/etckeeper-bzr/__init__.py +++ b/etckeeper-bzr/__init__.py @@ -3,29 +3,29 @@ """Runs etckeeper pre-commit when necessary.""" -import bzrlib -from bzrlib.mutabletree import MutableTree -from bzrlib.errors import BzrError, NotLocalUrl +from bzrlib.errors import BzrError import os -import subprocess - -if not (hasattr(MutableTree, "hooks") and "start_commit" in MutableTree.hooks): - raise "Version of Bazaar installed does not support required hooks." def etckeeper_startcommit_hook(tree): - if not os.path.exists(tree.abspath(".etckeeper")): + abspath = getattr(tree, "abspath", None) + if abspath is None or not os.path.exists(abspath(".etckeeper")): # Only run the commit hook when this is an etckeeper branch return - ret = subprocess.call(["etckeeper", "pre-commit", tree.abspath(".")]) + import subprocess + ret = subprocess.call(["etckeeper", "pre-commit", abspath(".")]) if ret != 0: raise BzrError("etckeeper pre-commit failed") -install_named_hook = getattr(MutableTree.hooks, 'install_named_hook', None) -if install_named_hook is not None: - install_named_hook('start_commit', etckeeper_startcommit_hook, 'etckeeper') +try: + from bzrlib.hooks import install_lazy_named_hook +except ImportError: + from bzrlib.mutabletree import MutableTree + MutableTree.hooks.install_named_hook('start_commit', + etckeeper_startcommit_hook, 'etckeeper') else: - MutableTree.hooks.install_hook('start_commit', etckeeper_startcommit_hook) - MutableTree.hooks.name_hook(etckeeper_startcommit_hook, "etckeeper") + install_lazy_named_hook( + "bzrlib.mutabletree", "MutableTree.hooks", + 'start_commit', etckeeper_startcommit_hook, 'etckeeper') if __name__ == "__main__": from distutils.core import setup diff --git a/etckeeper.1 b/etckeeper.1 deleted file mode 100644 index c313a0c..0000000 --- a/etckeeper.1 +++ /dev/null @@ -1,48 +0,0 @@ -.\" -*- nroff -*- -.TH ETCKEEPER 1 "" "" "" -.SH NAME -etckeeper \- store /etc in git, mercurial, or bazaar -.SH SYNOPSIS -.B etckeeper command [-d directory] -.SH DESCRIPTION -etckeeper manages /etc be stored in a git, mercurial, or bazaar -repository. By default each of the commands operates on /etc, but a -different directory can be specified 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, mercurial, or bazaar 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 commit [message] -Commits changes in /etc to the repository. A commit message can be -specified. -.TP -.B pre-commit -This is called as a pre-commit hook. It stores metadata and does sanity -checks. -.TP -.B pre-install -This is called by apt's DPkg::Pre-Install-Pkgs hook, or by equivilant hooks -of other package managers. It allows committing any uncommitted changes before -packages are installed, upgraded, etc. -.TP -.B post-install -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.) -.TP -.B unclean -This returns true if the directory contains uncommitted changes. -.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/etckeeper.8 b/etckeeper.8 new file mode 100644 index 0000000..a49c4b6 --- /dev/null +++ b/etckeeper.8 @@ -0,0 +1,71 @@ +.\" -*- nroff -*- +.TH ETCKEEPER 8 "" "" "" +.SH NAME +etckeeper \- store /etc in git, mercurial, bazaar, or darcs +.SH SYNOPSIS +.B etckeeper command [-d directory] +.SH DESCRIPTION +etckeeper manages /etc be stored in a git, mercurial, bazaar, or darcs +repository. By default each of the commands operates on /etc, but a +different directory can be specified to operate on a clone of the /etc +repository located elsewhere. +.SH COMMANDS +.TP +.B init +This initialises and sets up a git, mercurial, bazaar, or darcs +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 commit [message] +Commits all changes in /etc to the repository. A commit message can be +specified. You may also use the underlying VCS to commit manually. +(Note that etckeeper commit will notice if a user has used sudo or su to +become root, and record the original username in the commit.) +.TP +.B pre-commit +This is called as a pre-commit hook. It stores metadata and does sanity +checks. +.TP +.B pre-install +This is called by apt's DPkg::Pre-Install-Pkgs hook, or by equivalent hooks +of other package managers. It allows committing any uncommitted changes before +packages are installed, upgraded, etc. +.TP +.B post-install +This is called by apt's DPkg::Post-Invoke hook, or by equivalent 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.) +.TP +.B unclean +This returns true if the directory contains uncommitted changes. +.TP +.B update-ignore +This updates the VCS ignore file. Content outside a "managed by etckeeper" +block is not touched. This is generally run when upgrading to a new version +of etckeeper. +.TP +.B vcs subcommand [options ...] +You can use this to run any subcommand of the VCS that etckeeper is +configured to run. It will be run in /etc. For example, "etckeeper vcs +diff" will run "git diff", etc. +.TP +.B uninit [-f] +This command DESTROYS DATA! It is the inverse of the init command, removing +VCS information and etckeeper's own bookkeeping information from the +directory. Use with caution. A typical use case would be to run etckeeper +uninit, then modify etckeeper.conf to use a different VCS, and then run +etckeeper init. (The -f switch can be used to force uninit without +prompting.) +.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 ENVIRONMENT VARIABLES +ETCKEEPER_CONF_DIR path to configuration directory instead of default /etc/etckeeper. +.SH SEE ALSO +/usr/share/doc/etckeeper/README.gz +.SH AUTHOR +Joey Hess <joey@kitenet.net> diff --git a/etckeeper.conf b/etckeeper.conf index f1438ab..c95f377 100644 --- a/etckeeper.conf +++ b/etckeeper.conf @@ -1,16 +1,28 @@ # The VCS to use. -# VCS="hg" +#VCS="hg" VCS="git" -# VCS="bzr" +#VCS="bzr" +#VCS="darcs" # Options passed to git commit when run by etckeeper. -#GIT_COMMIT_OPTIONS="" +GIT_COMMIT_OPTIONS="" # Options passed to hg commit when run by etckeeper. -#HG_COMMIT_OPTIONS="" +HG_COMMIT_OPTIONS="" # Options passed to bzr commit when run by etckeeper. -#BZR_COMMIT_OPTIONS="" +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 the following to avoid special file warning +# (the option is enabled automatically by cronjob regardless). +#AVOID_SPECIAL_FILE_WARNING=1 # Uncomment to avoid etckeeper committing existing changes to # /etc before installation. It will cancel the installation, @@ -18,7 +30,9 @@ VCS="git" #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 diff --git a/etckeeper.spec b/etckeeper.spec new file mode 100644 index 0000000..ea2c13a --- /dev/null +++ b/etckeeper.spec @@ -0,0 +1,75 @@ +Name: etckeeper +Version: 0.58 +Release: 4%{?dist} +Summary: store /etc in git, mercurial, bzr or darcs + +Group: System Tools +License: GPLv2 +URL: http://kitenet.net/~joey/code/etckeeper/ +Source0: http://ftp.debian.org/debian/pool/main/e/etckeeper/%{name}_%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Requires: git >= 1.6.1-1 +Obsoletes: etckeeper = snapshot, yum-etckeeper + +%description +The etckeeper program is a tool to let /etc be stored in a git, +mercurial, bzr or darcs repository. It hooks into yum to automatically +commit changes made to /etc during package upgrades. It tracks file +metadata that 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. + +%prep +%setup -q -n %{name} +%{__perl} -pi -e ' + s|HIGHLEVEL_PACKAGE_MANAGER=apt|HIGHLEVEL_PACKAGE_MANAGER=yum|; + s|LOWLEVEL_PACKAGE_MANAGER=dpkg|LOWLEVEL_PACKAGE_MANAGER=rpm|; + ' %{_builddir}/%{name}/etckeeper.conf + + +%build +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +install -D debian/cron.daily $RPM_BUILD_ROOT/etc/cron.daily/etckeeper + + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +%{_bindir}/etckeeper init -d /etc/ +mkdir -p %{_var}/cache/etckeeper + +%files +%defattr(-,root,root,-) +%doc GPL INSTALL TODO README +%{_bindir}/* +%{_mandir}/* +# this isn't very clever and its a manual process update. +# but it works +%config(noreplace) /etc/yum/pluginconf.d/etckeeper.conf +%config(noreplace) /etc/etckeeper/etckeeper.conf +/etc/etckeeper/*.d/* +/etc/cron.daily/etckeeper +/etc/bash_completion.d/etckeeper +%{_prefix}/lib/* + +%changelog +* Fri Feb 27 2009 Jimmy Tang <jtang@tchpc.tcd.ie> - 0.33-4 +- fix up initial install to make directory in /var/cache/etckeeper +- install the etckeeper daily cron job +- define some config files that shouldn't be replaced, should the hooks +in commit.d, init.d etc... saved and not blown away? if so they can +defined as config files. etckeeper should record the changes anyway. + +* Wed Feb 25 2009 Jimmy Tang <jtang@tchpc.tcd.ie> - 0.32-1 +- yum etckeeper plugin is now apart of this package + +* Tue Feb 24 2009 Jimmy Tang <jtang@tchpc.tcd.ie> - 0.31-1 +- initial package diff --git a/init.d/20restore-etckeeper b/init.d/20restore-etckeeper index 984d521..0485e63 100755 --- a/init.d/20restore-etckeeper +++ b/init.d/20restore-etckeeper @@ -1,6 +1,17 @@ #!/bin/sh set -e +# Used by .etckeeper to run a command if the file it acts on +# (the last parameter) exists. +maybe () { + command="$1" + shift 1 + + if eval [ -e "\"\$$#\"" ]; then + "$command" "$@" + fi +} + # Yes, this runs code from the repository. As documented, etckeeper-init # should only be run on repositories you trust. if [ -e .etckeeper ]; then diff --git a/init.d/40vcs-init b/init.d/40vcs-init index bf2b03e..3c7a3bb 100755 --- a/init.d/40vcs-init +++ b/init.d/40vcs-init @@ -11,4 +11,7 @@ elif [ "$VCS" = hg ] && [ ! -e .hg ]; then elif [ "$VCS" = bzr ] && [ ! -e .bzr ]; then bzr init bzr nick "$(hostname) /etc repository" +elif [ "$VCS" = darcs ] && [ ! -e _darcs ]; then + darcs initialize + echo "$(hostname) /etc repository" > _darcs/prefs/motd fi diff --git a/init.d/50vcs-ignore b/init.d/50vcs-ignore index 43c245d..bcc88ba 100755 --- a/init.d/50vcs-ignore +++ b/init.d/50vcs-ignore @@ -1,78 +1,4 @@ #!/bin/sh set -e -if [ "$VCS" = git ] && [ ! -e .gitignore ]; then - file=.gitignore -elif [ "$VCS" = hg ] && [ ! -e .hgignore ]; then - file=.hgignore -elif [ "$VCS" = bzr ] && [ ! -e .bzrignore ]; then - file=.bzrignore -fi - -if [ -z "$file" ] || [ -e "$file" ]; then - exit 0 -fi - -nl() { - echo >>$file -} - -comment() { - comment="$1" - echo "# $comment" >>$file -} - -ignore() { - glob="$1" - - case "$VCS" in - git|bzr) - echo "$glob" >> $file - ;; - hg) - # rather than converting the glob to a regexp, just - # configure hg to use globs - if [ -z "$hg_syntax_printed" ]; then - comment "use glob syntax" - echo "syntax: glob" >> $file - nl - hg_syntax_printed=1 - fi - echo "$glob" >> $file - ;; - esac -} - -if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then - comment "new and old versions of conffiles, stored by dpkg" - ignore "*.dpkg-*" - nl -elif [ "$LOWLEVEL_PACKAGE_MANAGER" = "rpm" ]; then - comment "new and old versions of conffiles, stored by apt/rpm" - ignore "*.rpm*" - nl -elif [ "$LOWLEVEL_PACKAGE_MANAGER" = "pacman-g2" ]; then - comment "new and old versions of conffiles, stored by pacman" - ignore "*.pacnew" - ignore "*.pacorig" - ignore "*.pacsave" - nl -fi - -ignore "*~" -nl - -comment "mount(8) records system state here, no need to store these" -ignore blkid.tab -ignore blkid.tab.old -nl - -comment "some other files in /etc that typically do not need to be tracked" -ignore nologin -ignore ld.so.cache -ignore mtab -ignore .pwd.lock -ignore network/run -ignore adjtime -ignore lvm/cache -nl +etckeeper update-ignore || true diff --git a/init.d/50vcs-perm b/init.d/50vcs-perm index f9a6b8c..4dd080b 100755 --- a/init.d/50vcs-perm +++ b/init.d/50vcs-perm @@ -7,4 +7,6 @@ elif [ "$VCS" = hg ]; then chmod 700 .hg elif [ "$VCS" = bzr ]; then chmod 700 .bzr +elif [ "$VCS" = darcs ]; then + chmod 700 _darcs fi diff --git a/init.d/50vcs-pre-commit-hook b/init.d/50vcs-pre-commit-hook index de496fe..6045981 100755 --- a/init.d/50vcs-pre-commit-hook +++ b/init.d/50vcs-pre-commit-hook @@ -19,13 +19,30 @@ EOF ;; hg) if [ -e .hg/hgrc ] && grep "^\[hooks\]" .hg/hgrc; then - echo "etckeeper warning: [hooks] section in .hg/hgrc needs to be manually modified to run: etckeeper pre-commit -d `pwd`" >&2 + if ! grep "^pre-commit" .hg/hgrc | grep -q "etckeeper pre-commit"; then + echo "etckeeper warning: [hooks] section in .hg/hgrc needs to be manually modified to contain: pre-commit = etckeeper pre-commit -d `pwd`" >&2 + fi else - touch .hg/hgrc - cat >>.hg/hgrc <<EOF + touch .hg/hgrc + cat >>.hg/hgrc <<EOF [hooks] # pre-commit hook for etckeeper, to store metadata and do sanity checks -precommit = etckeeper pre-commit -d `pwd` +pre-commit = etckeeper pre-commit -d `pwd` +EOF + fi + ;; + darcs) + if [ -e _darcs/prefs/defaults ]; then + if ! ( grep -q "record prehook etckeeper pre-commit" _darcs/prefs/defaults && + grep -q "whatsnew prehook etckeeper pre-commit" _darcs/prefs/defaults ); then + echo "etckeeper warning: _darcs/prefs/defaults needs to be manually modified to run: etckeeper pre-commit -d `pwd`" >&2 + fi + else + cat >_darcs/prefs/defaults <<EOF +record prehook etckeeper pre-commit -d `pwd` +record run-prehook +whatsnew prehook etckeeper pre-commit -d `pwd` +whatsnew run-prehook EOF fi ;; diff --git a/init.d/60darcs-deleted-symlinks b/init.d/60darcs-deleted-symlinks new file mode 100755 index 0000000..9c34e95 --- /dev/null +++ b/init.d/60darcs-deleted-symlinks @@ -0,0 +1,48 @@ +#!/bin/sh +set -e + +filter_ignore() { + if [ "$VCS" = darcs ]; then + ignorefile=.darcsignore + fi + + if [ "$VCS" = darcs ] && [ -e "$ignorefile" ]; then + # Spaces embedded into patterns would break it. + # But really, why would anyone want to use ' ' instead of '\s' ? + #patterns=$( grep -v '^[[:space:]]*\(#\|$\)' "$ignorefile" | xargs -n 1 printf " -e %s" ) + #grep -Ev $patterns + #unset patterns + # Alternative using a temp file + patternsfile="$( mktemp -t etckeeper-$VCS.XXXXXXXXXX )" + grep -v '^[[:space:]]*\(#\|$\)' "$ignorefile" > "$patternsfile" || true + grep -Evf "$patternsfile" + rm -f "$patternsfile" + unset patternsfile + else + cat - + fi +} + + +if [ "$VCS" = darcs ];then + NOVCS='. -path ./.git -prune -o -path ./.bzr -prune -o -path ./.hg -prune -o -path ./_darcs -prune -o' + + # We assume that if .etckeeper is empty this is the first run + if [ -s .etckeeper ]; then + linksindex="$( mktemp -t etckeeper-$VCS.XXXXXXXXXX )" + grep '^ln -s' .etckeeper | while IFS="'" read n n n link n; do + printf "%s\n" "$link" >> "$linksindex" + done + + # Warn about symbolic links that shouldn't exist + if links=$( find $NOVCS -type l -print | filter_ignore | grep -vFf "$linksindex" ); then + printf "%s\n%s\n" \ + "The following symbolic links should not exist:" \ + "$links" >&2 + fi + + rm -f "$linksindex" + unset links linksindex + fi + +fi diff --git a/init.d/70vcs-add b/init.d/70vcs-add index e6ab3d1..9a9ec45 100755 --- a/init.d/70vcs-add +++ b/init.d/70vcs-add @@ -13,4 +13,15 @@ elif [ "$VCS" = bzr ]; then if ! bzr add .; then echo "etckeeper warning: bzr add failed" >&2 fi +elif [ "$VCS" = darcs ]; then + # Don't warn if all the files were already added. + rc=0 + res=$( darcs add -qr . 2>&1 ) || rc=$? + if test $rc -ne 0; then + if ! test $rc -eq 2 -a "${res%No files were added}" != "$res"; then + printf "%s" "$res" + echo "etckeeper warning: darcs add failed" >&2 + fi + fi + unset rc res fi diff --git a/list-installed.d/50list-installed b/list-installed.d/50list-installed index 116a42a..f3f4eed 100755 --- a/list-installed.d/50list-installed +++ b/list-installed.d/50list-installed @@ -1,8 +1,10 @@ #!/bin/sh # Output to stdout a *sorted* list of all currently installed # (or removed but still with config-files) packages, in the -# format "package version\n". +# format "package version\n" (or something similar). if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then dpkg-query -W -f '${Status}\t${Package} ${Version}\n' | \ egrep '(ok installed|ok config-files)' | cut -f2,3 +elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then + rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort fi diff --git a/post-install.d/50vcs-commit b/post-install.d/50vcs-commit index 12fd187..7710c4a 100755 --- a/post-install.d/50vcs-commit +++ b/post-install.d/50vcs-commit @@ -2,19 +2,22 @@ set -e pl="/var/cache/etckeeper/packagelist" -NL=" -" if etckeeper unclean; then message="committing changes in /etc after $HIGHLEVEL_PACKAGE_MANAGER run" if [ -e $pl.pre-install ]; then - diff="$(etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | egrep '^[-+]')" || true - if [ -n "$diff" ]; then - message="$message$NL${NL}Package changes:$NL$diff" - fi - rm -f $pl.pre-install + ( + echo "$message" + echo + echo "Package changes:" + etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | egrep '^[-+]' || true + ) | etckeeper commit --stdin + else + etckeeper commit "$(printf "$message")" fi - - etckeeper commit "$(printf "$message")" +fi + +if [ -e $pl.pre-install ]; then + rm -f $pl.pre-install fi diff --git a/pre-commit.d/20warn-hardlinks b/pre-commit.d/20warn-hardlinks deleted file mode 100755 index c1fd8f7..0000000 --- a/pre-commit.d/20warn-hardlinks +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -set -e - -if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then - hardlinks=$(find -type f -not -links 1 | grep -v /.git/ | grep -v /.hg/ | grep -v /.bzr/) || true - if [ -n "$hardlinks" ]; then - echo "etckeeper warning: hardlinked files could cause problems with $VCS:" >&2 - echo "$hardlinks" >&2 - fi -fi diff --git a/pre-commit.d/20warn-problem-files b/pre-commit.d/20warn-problem-files new file mode 100755 index 0000000..f7c7580 --- /dev/null +++ b/pre-commit.d/20warn-problem-files @@ -0,0 +1,30 @@ +#!/bin/sh +set -e + +exclude_internal () { + egrep -v '(^|/)(.git|.hg|.bzr|_darcs)/' +} + +if [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then + special=$(find . -not -type d -not -type f -not -type l | exclude_internal) || true + hardlinks=$(find . -type f -not -links 1 | exclude_internal ) || true +elif [ "$VCS" = hg ]; then + special=$(find . -not -type d -not -type f -not -type l | exclude_internal) || true + hardlinks=$(find . -type f -not -links 1 -exec hg status {} \; | exclude_internal ) || true +elif [ "$VCS" = git ]; then + special=$(find . -not -type d -not -type f -not -type l -exec git ls-files --exclude-standard --cached --others {} \; | exclude_internal) || true + hardlinks=$(find . -type f -not -links 1 -exec git ls-files --exclude-standard --cached --others {} \; | exclude_internal) || true +else + special="" +fi + +if [ -n "$special" ] && [ -z "$AVOID_SPECIAL_FILE_WARNING" ]; then + echo "etckeeper warning: special files could cause problems with $VCS:" >&2 + echo "$special" >&2 +fi +if [ -n "$hardlinks" ] && [ -z "$AVOID_SPECIAL_FILE_WARNING" ]; then + echo "etckeeper warning: hardlinked files could cause problems with $VCS:" >&2 + echo "$hardlinks" >&2 +fi + +true diff --git a/pre-commit.d/20warn-special-file b/pre-commit.d/20warn-special-file deleted file mode 100755 index 5712bc5..0000000 --- a/pre-commit.d/20warn-special-file +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -set -e - -if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then - special=$(find -not -type d -not -type f -not -type l | grep -v /.git/ | grep -v /.hg/ | grep -v /.bzr/) || true - if [ -n "$special" ]; then - echo "etckeeper warning: special files could cause problems with $VCS:" >&2 - echo "$special" >&2 - fi -fi - -true diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata index 243e019..b2a8678 100755 --- a/pre-commit.d/30store-metadata +++ b/pre-commit.d/30store-metadata @@ -14,14 +14,50 @@ filter_unknown() { done } +filter_ignore() { + if [ "$VCS" = darcs ]; then + ignorefile=.darcsignore + fi + + if [ "$VCS" = darcs ] && [ -e "$ignorefile" ]; then + patternsfile="$( mktemp -t etckeeper-$VCS.XXXXXXXXXX )" + grep -v '^[[:space:]]*\(#\|$\)' "$ignorefile" > "$patternsfile" || true + grep -Evf "$patternsfile" + rm -f "$patternsfile" + unset patternsfile + else + cat - + fi +} + +statf() { + while read statfile; do + printf "$(stat --format="$1" "$statfile") " + echo "$statfile" | shellquote + done +} + +shellquote() { + # Single quotes text, escaping existing single quotes. + sed -e "s/'/'\"'\"'/" -e "s/^/'/" -e "s/$/'/" +} + generate_metadata() { - # This function generates the script commands to fix any files - # that aren't owner=root, group=root, or mode=0644 or 0755. + # This function generates the script commands to fix any file + # ownerships that aren't owner=root, group=root, as well as to + # store the permissions of files. # The script is produced on stdout. Errors go to stderr. + # + # The script can use a 'maybe' function, which only runs a command + # if the file in its last argument exists. - # We maintain the permissions on the directory containing VCS data + # We want files in the directory containing VCS data # but we want find to ignore the VCS files themselves. - NOVCS='. -wholename ./.git -prune -o -wholename ./.bzr -prune -o -wholename ./.hg -prune -o' + # + # (Note that when using this, the find expression must end with + # -print or -exec, else the excluded directories will actually be + # printed!) + NOVCS='. -path ./.git -prune -o -path ./.bzr -prune -o -path ./.hg -prune -o -path ./_darcs -prune -o' # Keep the sort order the same at all times. LC_COLLATE=C @@ -30,31 +66,38 @@ generate_metadata() { if [ "$VCS" = git ] || [ "$VCS" = hg ]; then # These version control systems do not track directories, # so empty directories must be stored specially. - find -type d -empty | grep -v /.git/ | grep -v /.hg/ | grep -v /.bzr/ | - sort | sed -e "s/^/mkdir -p '/" -e "s/\$/'/" + find $NOVCS -type d -empty -print | + sort | shellquote | sed -e "s/^/mkdir -p /" fi - # Find all files and directories that don't have root as the owner - find $NOVCS \! -user root -exec stat --format="chown %U '{}'" {} \; \ - | sort | filter_unknown chown owner + if [ "$VCS" = darcs ]; then + # This version control system does not track symlinks, + # so they must be stored specially. + find $NOVCS -type l -print | sort | filter_ignore | while read link; do + dest=$( readlink "$link" ) + printf "ln -sf '%s' '%s'\n" "$(echo "$dest" | shellquote)" "$(echo "$link" | shellquote)" + done + fi + + # Find all files and directories that don't have the current user as the owner + find $NOVCS \! -user "$(id -u)" -print | statf "maybe chown %U" | sort | filter_unknown 'maybe chown' owner # Find all files and directories that don't have root as the group - find $NOVCS \! -group root -exec stat --format="chgrp %G '{}'" {} \; \ - | sort | filter_unknown chgrp group - - # Find all directories that aren't 0755 - find $NOVCS -type d \! -perm 0755 \ - -exec stat --format="chmod %a '{}'" {} \; | sort + find $NOVCS \! -group $(id -g) -print | statf "maybe chgrp %G" | sort | filter_unknown 'maybe chgrp' group - # Find all files that aren't 0644 or 0755 (we can assume the VCS will - # maintain the executable bit). - find $NOVCS -type f \! -perm 0644 \! -perm 0755 \ - -exec stat --format="chmod %a '{}'" {} \; | sort + # Store all file modes, in case the user has an unusual umask. + find $NOVCS \( -type f -or -type d \) -print | sort | perl -ne ' + BEGIN { $q=chr(39) } + chomp; + my $mode = (stat($_))[2]; + s/$q/$q"$q"$q/g; # escape single quotes + printf "maybe chmod %04o %s\n", $mode & 07777, "$q$_$q"; + ' # We don't handle xattrs. # Maybe check for getfattr/setfattr and use them if they're available? } -if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then +if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then if [ -f .metadata ]; then # remove obsolete .metadata file # git allows fully deleting it at this point, other VCS @@ -80,6 +123,6 @@ if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then # this will do nothing if the metadata file is unchanged. git add .etckeeper fi - # hg and bzr add not done, they will automatically + # hg, bzr and darcs add not done, they will automatically # include the file in the current commit fi diff --git a/pre-install.d/10packagelist b/pre-install.d/10packagelist index f83acee..e5fefa8 100755 --- a/pre-install.d/10packagelist +++ b/pre-install.d/10packagelist @@ -1,3 +1,4 @@ #!/bin/sh # This list will be later used when committing. +mkdir -p /var/cache/etckeeper/ etckeeper list-installed > /var/cache/etckeeper/packagelist.pre-install diff --git a/pre-install.d/50uncommitted-changes b/pre-install.d/50uncommitted-changes index 47750ac..d03d0e8 100755 --- a/pre-install.d/50uncommitted-changes +++ b/pre-install.d/50uncommitted-changes @@ -7,6 +7,7 @@ if [ "$1" = "fail-debconf" ]; then db_input critical etckeeper/commit_failed || true db_go || true db_reset etckeeper/commit_failed || true + exit 0 fi if etckeeper unclean; then diff --git a/unclean.d/50test b/unclean.d/50test index 9dfefc3..84e6be7 100755 --- a/unclean.d/50test +++ b/unclean.d/50test @@ -7,4 +7,6 @@ elif [ "$VCS" = hg ]; then [ -d .hg ] && ! hg status 2>&1 | wc -l | grep -q "^0$" elif [ "$VCS" = bzr ]; then [ -d .bzr ] && ! bzr status 2>/dev/null | wc -l | grep -q "^0$" +elif [ "$VCS" = darcs ]; then + [ -d _darcs ] && darcs whatsnew -l >/dev/null fi diff --git a/uninit.d/01prompt b/uninit.d/01prompt new file mode 100755 index 0000000..07f2e41 --- /dev/null +++ b/uninit.d/01prompt @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +if [ "$1" != "-f" ]; then + echo "** Warning: This will DESTROY all recorded history for $ETCKEEPER_DIR," + echo "** including the $VCS repository and ignore file." + echo "" + printf "Are you sure you want to do this? [yN] " + read answer + case "$answer" in + [Yy]*) + echo "Proceeding.." + exit 0 + ;; + *) + echo "Aborting etckeeper uninit." + exit 1 + ;; + esac +fi diff --git a/uninit.d/50remove-metadata b/uninit.d/50remove-metadata new file mode 100755 index 0000000..0be8d36 --- /dev/null +++ b/uninit.d/50remove-metadata @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +# Files generated by etckeeper to store metadata the VCS cannot preserve. +rm -f .etckeeper +rm -f .metadata # only generated by old versions diff --git a/uninit.d/50vcs-uninit b/uninit.d/50vcs-uninit new file mode 100755 index 0000000..eb9f13a --- /dev/null +++ b/uninit.d/50vcs-uninit @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +if [ "$VCS" = git ]; then + rm -rf .git + file=.gitignore +elif [ "$VCS" = hg ]; then + rm -rf .hg + file=.hgignore +elif [ "$VCS" = bzr ]; then + rm -rf .bzr + file=.bzrignore +elif [ "$VCS" = darcs ]; then + rm -rf _darcs + file=.darcsignore +fi + +managed_by_etckeeper="managed by etckeeper" + +if ! grep -q "$managed_by_etckeeper" "$file"; then + echo "etckeeper: "$file" does not contain \"$managed_by_etckeeper\" comment; not removing" +else + rm -f $file +fi diff --git a/uninit.d/README b/uninit.d/README new file mode 100644 index 0000000..d1a4eaa --- /dev/null +++ b/uninit.d/README @@ -0,0 +1,2 @@ +Executable files in this directory are run to uninitialise the working +directory, removing files added by `etckeeper init`. diff --git a/update-ignore.d/01update-ignore b/update-ignore.d/01update-ignore new file mode 100755 index 0000000..6d583eb --- /dev/null +++ b/update-ignore.d/01update-ignore @@ -0,0 +1,196 @@ +#!/bin/sh +set -e + +if [ "$VCS" = git ]; then + dir=.git + file=.gitignore +elif [ "$VCS" = hg ]; then + dir=.hg + file=.hgignore +elif [ "$VCS" = bzr ]; then + dir=.bzr + file=.bzrignore +elif [ "$VCS" = darcs ]; then + dir=_darcs + file=.darcsignore +else + echo "etckeeper: unsupported VCS $VCS" >&2 + exit 1 +fi + +if [ ! -d "$dir" ]; then + exit 0 +fi + +managed_by_etckeeper="managed by etckeeper" + +nl() { + echo >>"$file" +} + +comment() { + comment="$1" + echo "# $comment" >>"$file" +} + +ignore() { + glob="$1" + + case "$VCS" in + git) + # escape "#" in ignores, as otherwise it may + # be considered a comment + echo "$glob" | sed 's/#/\\#/g' >>"$file" + ;; + bzr) + echo "$glob" >>"$file" + ;; + hg) + # rather than converting the glob to a regexp, just + # configure hg to use globs + if [ -z "$hg_syntax_printed" ]; then + comment "use glob syntax" + echo "syntax: glob" >>"$file" + nl + hg_syntax_printed=1 + fi + echo "$glob" | sed 's/#/\\#/g' >>"$file" + ;; + darcs) + # darcs doesn't understand globs, so we need to + # translate them into regexs. Not a complete converter, + # but suitable for given globs. + if [ "${glob%\*}" != "$glob" ]; then + glob="${glob%\*}" + else + glob="$glob"'($|/)' + fi + if [ "${glob#\*}" != "$glob" ]; then + glob="${glob#\*}" + else + glob='(^|/)'"$glob" + fi + glob="$( printf %s $glob | sed -e 's/\./\\./g;s/\*/[^\/]*/g;s/\?/[^\/]/g' )" + echo "$glob" >>"$file" + esac +} + +writefile () { + comment "begin section $managed_by_etckeeper (do not edit this section by hand)" + nl + + if [ "$VCS" = darcs ]; then + darcs setpref boringfile .darcsignore + fi + + if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then + comment "new and old versions of conffiles, stored by dpkg" + ignore "*.dpkg-*" + comment "new and old versions of conffiles, stored by ucf" + ignore "*.ucf-*" + nl + elif [ "$LOWLEVEL_PACKAGE_MANAGER" = "rpm" ]; then + comment "new and old versions of conffiles, stored by apt/rpm" + ignore "*.rpm*" + nl + elif [ "$LOWLEVEL_PACKAGE_MANAGER" = "pacman-g2" ]; then + comment "new and old versions of conffiles, stored by pacman" + ignore "*.pacnew" + ignore "*.pacorig" + ignore "*.pacsave" + nl + fi + + comment "old versions of files" + ignore "*.old" + # Not currently ignored as admins tend to rely on these files. + #ignore "passwd-" + #ignore "group-" + #ignore "shadow-" + #ignore "gshadow-" + nl + + comment "mount(8) records system state here, no need to store these" + ignore blkid.tab + ignore blkid.tab.old + nl + + comment "some other files in /etc that typically do not need to be tracked" + ignore nologin + ignore ld.so.cache + ignore prelink.cache + ignore mtab + ignore mtab.fuselock + ignore .pwd.lock + ignore "*.LOCK" + ignore network/run + ignore adjtime + ignore lvm/cache + ignore lvm/backup + ignore lvm/archive + ignore "X11/xdm/authdir/authfiles/*" + ignore ntp.conf.dhcp + ignore .initctl + ignore "webmin/fsdump/*.status" + ignore "webmin/webmin/oscache" + ignore "apparmor.d/cache/*" + ignore "service/*/supervise/*" + ignore "service/*/log/supervise/*" + ignore "sv/*/supervise/*" + ignore "sv/*/log/supervise/*" + ignore "*.elc" + ignore "*.pyc" + ignore "*.pyo" + ignore "init.d/.depend.*" + ignore "openvpn/openvpn-status.log" + nl + + comment "editor temp files" + ignore "*~" + ignore ".*.sw?" + ignore ".sw?" + ignore "#*#" + ignore DEADJOE + + nl + comment "end section $managed_by_etckeeper" +} + +if [ -e "$file" ]; then + if ! grep -q "$managed_by_etckeeper" "$file"; then + echo "etckeeper: "$file" does not contain \"$managed_by_etckeeper\" comment; not updating" + exit 1 + fi + realfile="$file" + if [ -n "`type -p tempfile`" ]; then + tempfile="tempfile" + elif [ -n "`type -p mktemp`" ]; then + tempfile="mktemp" + else + echo "etckeeper warning: can't find tempfile or mktemp" >&2 + fi + file=$($tempfile) + ( + skipping= + while read line; do + if echo "$line" | grep -q "$managed_by_etckeeper"; then + if [ ! "$skipping" ]; then + skipping=1 + else + skipping= + writefile + fi + elif [ ! "$skipping" ]; then + echo "$line" >> "$file" + fi + done + if [ "$skipping" ]; then + # reached end of file w/o ending block + writefile + fi + ) <"$realfile" + + mv -f "$file" "$realfile" +else + writefile +fi diff --git a/update-ignore.d/README b/update-ignore.d/README new file mode 100644 index 0000000..a573135 --- /dev/null +++ b/update-ignore.d/README @@ -0,0 +1,2 @@ +Executable files in this directory are run to update the VCS ignore file, +or create it if it does not exist. diff --git a/vcs.d/50vcs-cmd b/vcs.d/50vcs-cmd new file mode 100755 index 0000000..f515abb --- /dev/null +++ b/vcs.d/50vcs-cmd @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +# check whether we can locate the vcs binary +if [ -n "$VCS" ] && which "$VCS" > /dev/null; then + # pass commands to the VCS application + $VCS "$@" +else + echo "error: VCS ($VCS) not set or not in PATH" >&2 + exit 1 +fi diff --git a/yum-etckeeper.conf b/yum-etckeeper.conf new file mode 100644 index 0000000..8e4d76c --- /dev/null +++ b/yum-etckeeper.conf @@ -0,0 +1,2 @@ +[main] +enabled=1 diff --git a/yum-etckeeper.py b/yum-etckeeper.py new file mode 100644 index 0000000..2e966f8 --- /dev/null +++ b/yum-etckeeper.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# +# author: jtang@tchpc.tcd.ie +# +# this plugin is based on the hello world example +# from http://yum.baseurl.org/wiki/WritingYumPlugins +# +# to install, copy this file to /usr/lib/yum-plugins/etckeeper.py +# and then create /etc/yum/pluginconf.d/etckeeper.conf with the contents +# below. +# +# /etc/yum/pluginconf.d/etckeeper.conf: +# [main] +# enabled=1 +# + +import os +from glob import fnmatch + +import yum +from yum.plugins import PluginYumExit, TYPE_CORE + +requires_api_version = '2.1' +plugin_type = (TYPE_CORE,) + +def pretrans_hook(conduit): + conduit.info(2, 'etckeeper: pre transaction commit') + servicecmd = conduit.confString('main', 'servicecmd', '/usr/bin/etckeeper') + command = '%s %s' % (servicecmd, " pre-install") + ret = os.system(command) + if ret != 0: + raise PluginYumExit('etckeeper returned %d' % (ret >> 8)) + +def posttrans_hook(conduit): + conduit.info(2, 'etckeeper: post transaction commit') + servicecmd = conduit.confString('main', 'servicecmd', '/usr/bin/etckeeper') + command = '%s %s > /dev/null' % (servicecmd, "post-install") + os.system(command) |