#!/bin/sh
# Clean up diversions from previous versions of the package.
+#
+# Any existing klogin.1.gz man page is removed here since otherwise if the
+# package was upgraded to a version without the diversion, downgraded to a
+# version with the diversion, and then upgraded again, the man page exists
+# under both names and dpkg-divert refuses to overwrite klogin.1.gz. Since
+# we're installing a package that's about to provide klogin.1.gz and
+# conflict with everything else in Debian that provides a file of that name,
+# this appears to be the expedient fix.
set -e
if [ upgrade = "$1" ] && dpkg --compare-versions "$2" lt 1.8-2 ; then
+ rm -f /usr/share/man/man1/klogin.1.gz
dpkg-divert --package kftgt --remove --rename \
--divert /usr/share/man/man1/klogin-krb4kth-clients.1.gz \
/usr/share/man/man1/klogin.1.gz