diff options
author | Colin Watson <cjwatson@debian.org> | 2013-05-22 00:59:33 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2013-05-22 00:59:33 +0100 |
commit | afd3292952a9f0bb107046785ddcfad446d69b89 (patch) | |
tree | 9894061066d4a1804faecd731b2899bbd924b63e /debian/openssh-server.preinst | |
parent | 6f4754f269cb99609cc27d358873bcbdb574cfd6 (diff) |
Replace old manual conffile handling code with dpkg-maintscript-helper,
via dh_installdeb.
Diffstat (limited to 'debian/openssh-server.preinst')
-rw-r--r-- | debian/openssh-server.preinst | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/debian/openssh-server.preinst b/debian/openssh-server.preinst index 8bb2d6f1a..559693f7b 100644 --- a/debian/openssh-server.preinst +++ b/debian/openssh-server.preinst | |||
@@ -3,25 +3,8 @@ | |||
3 | action=$1 | 3 | action=$1 |
4 | version=$2 | 4 | version=$2 |
5 | 5 | ||
6 | prepare_mv_conffile () { | ||
7 | CONFFILE="$1" | ||
8 | [ -e "$CONFFILE" ] || return 0 | ||
9 | |||
10 | md5sum="$(md5sum "$CONFFILE" | sed -e 's/ .*//')" | ||
11 | old_md5sum="$(dpkg-query -W -f '${Conffiles}\n' openssh-server 2>/dev/null | sed 's/^ *//' | awk '$1 == "'"$CONFFILE"'" { print $2 }')" | ||
12 | if [ "$md5sum" = "$old_md5sum" ]; then | ||
13 | mv -f "$CONFFILE" "$CONFFILE.dpkg-old" | ||
14 | else | ||
15 | mv -f "$CONFFILE" "$CONFFILE.moving" | ||
16 | fi | ||
17 | } | ||
18 | |||
19 | if [ "$action" = upgrade ] || [ "$action" = install ] | 6 | if [ "$action" = upgrade ] || [ "$action" = install ] |
20 | then | 7 | then |
21 | if dpkg --compare-versions "$version" lt 1:4.7p1-4; then | ||
22 | prepare_mv_conffile /etc/pam.d/ssh | ||
23 | fi | ||
24 | |||
25 | if dpkg --compare-versions "$version" lt 1:5.5p1-6 && \ | 8 | if dpkg --compare-versions "$version" lt 1:5.5p1-6 && \ |
26 | [ -d /var/run/sshd ]; then | 9 | [ -d /var/run/sshd ]; then |
27 | # make sure /var/run/sshd is not removed on upgrades | 10 | # make sure /var/run/sshd is not removed on upgrades |
@@ -30,3 +13,5 @@ then | |||
30 | fi | 13 | fi |
31 | 14 | ||
32 | #DEBHELPER# | 15 | #DEBHELPER# |
16 | |||
17 | exit 0 | ||