summaryrefslogtreecommitdiff
path: root/init.d/50vcs-pre-commit-hook
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-02-04 21:57:13 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-02-04 21:57:13 -0500
commit40c6067eb67f28d207cf57f8ba2fc549315827b5 (patch)
tree51739f8915e3ddadc5fa0815c56672eae6ba064f /init.d/50vcs-pre-commit-hook
parentbc5d04189542e6da934f7c901b0765891cc5c1d1 (diff)
Support darcs. Thanks to Gian Piero Carrubba. Closes: #510032
Diffstat (limited to 'init.d/50vcs-pre-commit-hook')
-rwxr-xr-xinit.d/50vcs-pre-commit-hook15
1 files changed, 15 insertions, 0 deletions
diff --git a/init.d/50vcs-pre-commit-hook b/init.d/50vcs-pre-commit-hook
index de496fe..06d433b 100755
--- a/init.d/50vcs-pre-commit-hook
+++ b/init.d/50vcs-pre-commit-hook
@@ -29,4 +29,19 @@ precommit = 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
+ ;;
esac