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-client.postrm | |
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-client.postrm')
-rw-r--r-- | debian/openssh-client.postrm | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/debian/openssh-client.postrm b/debian/openssh-client.postrm index 139fb4d12..4d52a7beb 100644 --- a/debian/openssh-client.postrm +++ b/debian/openssh-client.postrm | |||
@@ -2,19 +2,31 @@ | |||
2 | 2 | ||
3 | #DEBHELPER# | 3 | #DEBHELPER# |
4 | 4 | ||
5 | if [ "$1" = "purge" ] | 5 | abort_transfer_conffile () { |
6 | then | 6 | CONFFILE="$1" |
7 | # Remove all non-conffiles that ssh might create, so that we can | 7 | if [ -e "$CONFFILE.moved-by-preinst" ]; then |
8 | # smoothly remove /etc/ssh if and only if the user hasn't dropped some | 8 | echo >&2 "Aborting ownership transfer of conffile $CONFFILE ..." |
9 | # other files in there. Conffiles have already been removed at this | 9 | mv -f "$CONFFILE.moved-by-preinst" "$CONFFILE" |
10 | # point. | 10 | return 0 |
11 | rm -f /etc/ssh/moduli /etc/ssh/primes | 11 | fi |
12 | rm -f /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 | 12 | } |
13 | rmdir --ignore-fail-on-non-empty /etc/ssh | ||
14 | fi | ||
15 | 13 | ||
16 | if [ "$1" = "purge" ] ; then | 14 | case $1 in |
17 | delgroup --quiet ssh > /dev/null || true | 15 | abort-install|abort-upgrade) |
18 | fi | 16 | abort_transfer_conffile /etc/ssh/moduli |
17 | abort_transfer_conffile /etc/ssh/ssh_config | ||
18 | ;; | ||
19 | purge) | ||
20 | # Remove all non-conffiles that ssh might create, so that we | ||
21 | # can smoothly remove /etc/ssh if and only if the user | ||
22 | # hasn't dropped some other files in there. Conffiles have | ||
23 | # already been removed at this point. | ||
24 | rm -f /etc/ssh/moduli /etc/ssh/primes | ||
25 | rm -f /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 | ||
26 | rmdir --ignore-fail-on-non-empty /etc/ssh | ||
27 | |||
28 | delgroup --quiet ssh > /dev/null || true | ||
29 | ;; | ||
30 | esac | ||
19 | 31 | ||
20 | exit 0 | 32 | exit 0 |