-rm -f "$VARLIB"/gnupg-host/gpg.conf
-rm -f "$VARLIB"/gnupg-authentication/gpg.conf
-rmdir --ignore-fail-on-non-empty "$VARLIB"/gnupg-host || true
-rmdir --ignore-fail-on-non-empty "$VARLIB"/gnupg-authentication || true
+set -e
+
+case "$1" in
+ upgrade)
+ if dpkg --compare-versions "$2" lt 0.23 ; then
+ cat >&2 <<EOF
+
+Downgrading the monkeysphere to a version earlier than 0.23 can have
+BAD CONSEQUENCES, including potentially locking you out of the system.
+Downgrading in this fashion is NOT SUPPORTED.
+
+EOF
+
+ exit 1
+ fi
+ ;;
+esac