From 0aa591164a24b34f4979f5b36df51a808ac8c3ca Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 27 May 2009 14:49:01 -0400 Subject: Make postinst check for the configured VCS before trying to run etckeeper init. Closes: #530497 --- debian/postinst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'debian/postinst') diff --git a/debian/postinst b/debian/postinst index 870d67b..ca0b788 100644 --- a/debian/postinst +++ b/debian/postinst @@ -75,8 +75,12 @@ configure) if [ "$2" = "" ]; then # Fresh install. - # Might fail if, eg, git is not installed. - etckeeper init || echo "etckeeper init failed; run it by hand" >&2 + . /etc/etckeeper/etckeeper.conf || true + if [ -n "$VCS" ] && [ -x "`which $VCS 2>/dev/null`" ]; then + etckeeper init || echo "etckeeper init failed; run it by hand" >&2 + 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 -- cgit v1.2.3