summaryrefslogtreecommitdiff
path: root/debian/openssh-server.preinst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2006-12-06 21:55:19 +0000
committerColin Watson <cjwatson@debian.org>2006-12-06 21:55:19 +0000
commite2f4fb43875e216cbcf7cabbb621ecb205c24857 (patch)
tree65aac6efdb62456154277787f5fdf4e718997684 /debian/openssh-server.preinst
parentd23e75730cfd617b7638e3b8013e3e1f3a1ecce9 (diff)
* When installing openssh-client or openssh-server from scratch, remove
any unchanged conffiles from the pre-split ssh package to work around a bug in sarge's dpkg (thanks, Justin Pryzby and others; closes: #335276).
Diffstat (limited to 'debian/openssh-server.preinst')
-rw-r--r--debian/openssh-server.preinst19
1 files changed, 19 insertions, 0 deletions
diff --git a/debian/openssh-server.preinst b/debian/openssh-server.preinst
index 412e51564..a5c507bd4 100644
--- a/debian/openssh-server.preinst
+++ b/debian/openssh-server.preinst
@@ -3,6 +3,19 @@
3action=$1 3action=$1
4version=$2 4version=$2
5 5
6prepare_transfer_conffile () {
7 CONFFILE="$1"
8 [ -e "$CONFFILE" ] || return 0
9
10 md5sum="$(md5sum "$CONFFILE" |sed -e 's/ .*//')"
11 old_md5sum="$(sed -n -e "/^Conffiles:/,/^[^ ]/{\\' $CONFFILE'{s/^ [^ ]* //;s/ .*//;p}}" /var/lib/dpkg/status)"
12 if [ "$md5sum" = "$old_md5sum" ]; then
13 echo >&2 "Transferring ownership of conffile $CONFFILE ..."
14 mv -f "$CONFFILE" "$CONFFILE.moved-by-preinst"
15 return 0
16 fi
17}
18
6if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then 19if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then
7 version=1.2.27 20 version=1.2.27
8fi 21fi
@@ -77,6 +90,12 @@ EOF
77 fi 90 fi
78 } 91 }
79 fi 92 fi
93
94 if dpkg --compare-versions "$version" lt 0; then
95 prepare_transfer_conffile /etc/default/ssh
96 prepare_transfer_conffile /etc/init.d/ssh
97 prepare_transfer_conffile /etc/pam.d/ssh
98 fi
80fi 99fi
81 100
82#DEBHELPER# 101#DEBHELPER#