summaryrefslogtreecommitdiff
path: root/commit.d
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 /commit.d
parentbc5d04189542e6da934f7c901b0765891cc5c1d1 (diff)
Support darcs. Thanks to Gian Piero Carrubba. Closes: #510032
Diffstat (limited to 'commit.d')
-rwxr-xr-xcommit.d/10vcs-test2
-rw-r--r--commit.d/30darcs-add14
-rwxr-xr-xcommit.d/50vcs-commit6
3 files changed, 22 insertions, 0 deletions
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 100644
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/50vcs-commit b/commit.d/50vcs-commit
index 8a0c0b6..1f4ab03 100755
--- a/commit.d/50vcs-commit
+++ b/commit.d/50vcs-commit
@@ -32,4 +32,10 @@ elif [ "$VCS" = bzr ] && [ -d .bzr ]; then
else
bzr commit $BZR_COMMIT_OPTIONS
fi
+elif [ "$VCS" = darcs ] && [ -d _darcs ]; then
+ logfile="$( mktemp -t etckeeper-$VCS.XXXXXXXXXX )"
+ printf "%b" "$message" > "$logfile"
+ darcs record $DARCS_COMMIT_OPTIONS --logfile="$logfile"
+ rm -f "$logfile"
+ unset logfile
fi