diff options
author | Colin Watson <cjwatson@debian.org> | 2006-12-06 21:55:19 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2006-12-06 21:55:19 +0000 |
commit | e2f4fb43875e216cbcf7cabbb621ecb205c24857 (patch) | |
tree | 65aac6efdb62456154277787f5fdf4e718997684 /debian/openssh-server.preinst | |
parent | d23e75730cfd617b7638e3b8013e3e1f3a1ecce9 (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.preinst | 19 |
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 @@ | |||
3 | action=$1 | 3 | action=$1 |
4 | version=$2 | 4 | version=$2 |
5 | 5 | ||
6 | prepare_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 | |||
6 | if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then | 19 | if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then |
7 | version=1.2.27 | 20 | version=1.2.27 |
8 | fi | 21 | fi |
@@ -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 | ||
80 | fi | 99 | fi |
81 | 100 | ||
82 | #DEBHELPER# | 101 | #DEBHELPER# |