From c8f16796c6c72251814626ccf911d8f025cc60f3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Jan 2008 14:21:46 -0500 Subject: * Convert the directory parameter of etckeeper into "-d directory". * Pass other patameters on from etckeeper to the .d scripts. * Stop using run-parts for various reasons. * Split out a commit.d that contains committing code that's used by both the pre-install.d and post-install.d scripts. * Split out an unclean.d that tests if the WC contains uncommitted changes. * Add preinst code to remove old post-install.d scripts. --- commit.d/50vcs-commit | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 commit.d/50vcs-commit (limited to 'commit.d/50vcs-commit') diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit new file mode 100755 index 0000000..48fa177 --- /dev/null +++ b/commit.d/50vcs-commit @@ -0,0 +1,18 @@ +#!/bin/sh +set -e + +message="$1" + +if [ "$VCS" = git ] && [ -d .git ]; then + if [ -n "$message" ]; then + git commit $GIT_COMMIT_OPTIONS -m "$message" + else + git commit $GIT_COMMIT_OPTIONS + fi +elif [ "$VCS" = hg ] && [ -d .hg ]; then + if [ -n "$message" ]; then + hg commit $HG_COMMIT_OPTIONS -m "$message" + else + hg commit $HG_COMMIT_OPTIONS + fi +fi -- cgit v1.2.3