change makefile to use git-buildpackage for debian packaging
[monkeysphere.git] / packaging / debian / monkeysphere.prerm
index 05b29e6faa52aa337eb3e4ae2cf75bcc50bc1feb..1a5135a5e9cdc9418956cda090876083878972c7 100755 (executable)
@@ -2,15 +2,31 @@
 
 # prerm script for monkeysphere
 
-# Author: Jameson Rollins <jrollins@fifthhorseman.net>
-# Copyright 2008
+# the only thing we're doing here is making sure that the local
+# administrator is not trying to downgrade to a version below 0.23,
+# since there was such a major reorganization of system data during
+# the transition to 0.23.
 
-VARLIB="/var/lib/monkeysphere"
+# Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+# Copyright 2009
 
-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
 
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.