Package: git
Version: 1:1.7.7-1
Followup-For: Bug #645005

Hi,

I was also confronted to the problem. I slightly modified the postinst
script to skip the whole thing if the version provided as argument is an
empty string.

I attached the patch to this mail.

Cheers,

Simon
>From 1b7039ad6c0e59f3e2ea644e39cd7854154309f9 Mon Sep 17 00:00:00 2001
From: Simon Chopin <[email protected]>
Date: Wed, 12 Oct 2011 07:28:53 +0200
Subject: [PATCH] postinst: Fix fresh install contrib/hooks cleaning

The postinstall script now only attempts the removal if the version
string given as argument $2 is not empty, i.e. if it is in fact an
upgrade.
---
 debian/git.postinst |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/git.postinst b/debian/git.postinst
index 8cf7ad3..332d77c 100644
--- a/debian/git.postinst
+++ b/debian/git.postinst
@@ -34,7 +34,7 @@ fi
 
 # 1.7.7-1 replaces /usr/share/doc/git/contrib/hooks with a symlink,
 # but dpkg doesn't do so on package upgrade
-if dpkg --compare-versions "$2" lt '1:1.7.7-1' &&
+if test -n "$2" && dpkg --compare-versions "$2" lt '1:1.7.7-1' &&
    test -d /usr/share/doc/git/contrib/hooks; then
   rmdir /usr/share/doc/git/contrib/hooks &&
   ln -s ../../../git-core/contrib/hooks \
-- 
1.7.7

Reply via email to