summaryrefslogtreecommitdiff
path: root/debian/openssh-client.preinst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2013-05-21 23:41:23 +0100
committerColin Watson <cjwatson@debian.org>2013-05-21 23:41:23 +0100
commit1fa04ebf122aec5ecbbdb6c7e001665b238e4c62 (patch)
tree3d228c46959931802ddcc289bd658ccda5ab4738 /debian/openssh-client.preinst
parentcc7c64fe532ac804ce6c65d701a32b614cc0b26a (diff)
Drop conffile handling for upgrades from pre-split ssh package; this was
originally added in 1:4.3p2-7 / 1:4.3p2-8, and contained a truly ghastly hack around a misbehaviour in sarge's dpkg. Since this is now four Debian releases ago, we can afford to drop this and simplify the packaging.
Diffstat (limited to 'debian/openssh-client.preinst')
-rw-r--r--debian/openssh-client.preinst49
1 files changed, 0 insertions, 49 deletions
diff --git a/debian/openssh-client.preinst b/debian/openssh-client.preinst
deleted file mode 100644
index 0b29c051d..000000000
--- a/debian/openssh-client.preinst
+++ /dev/null
@@ -1,49 +0,0 @@
1#! /bin/sh -e
2
3ETC_SSH_MODULI=@ETC_SSH_MODULI@
4
5ETC_SSH_SSH_CONFIG=@ETC_SSH_SSH_CONFIG@
6
7action="$1"
8version="$2"
9
10prepare_transfer_conffile () {
11 CONFFILE="$1"
12 TEXT="$2"
13 MODE="$3"
14 [ "$CONFFILES" ] || return 0
15 [ -e "$CONFFILE" ] || return 0
16
17 md5sum="$(md5sum "$CONFFILE" |sed -e 's/ .*//')"
18 old_md5sum="$(echo "$CONFFILES" | awk '$1 == "'"$CONFFILE"'" { print $2 }')"
19 if [ "$md5sum" = "$old_md5sum" ]; then
20 echo >&2 "Transferring ownership of conffile $CONFFILE ..."
21 # We have to write out the desired new text of the conffile,
22 # which is tricky in the preinst, hence the nasty way we
23 # have to hardcode the text here. Fortunately, this is only
24 # necessary with sarge's dpkg and older.
25 if echo "$TEXT" | head -n1 | grep -q '^@.*@$'; then
26 echo >&2 'Unsubstituted conffile text! Please report this bug.'
27 exit 1
28 fi
29 printf '%s' "$TEXT" >"$CONFFILE.dpkg-new"
30 chmod "$MODE" "$CONFFILE.dpkg-new"
31 mv -f "$CONFFILE" "$CONFFILE.moved-by-preinst"
32 mv -f "$CONFFILE.dpkg-new" "$CONFFILE"
33 return 0
34 fi
35}
36
37case $action in
38 install|upgrade)
39 if dpkg --compare-versions "$version" lt 0; then
40 CONFFILES="$(dpkg-query -W -f '${Conffiles}\n' ssh 2>/dev/null | sed 's/^ *//')"
41 prepare_transfer_conffile /etc/ssh/moduli "$ETC_SSH_MODULI" 0644
42 prepare_transfer_conffile /etc/ssh/ssh_config "$ETC_SSH_SSH_CONFIG" 0644
43 fi
44 ;;
45esac
46
47#DEBHELPER#
48
49exit 0