add 0.28 transition script to generate new host_keys.pub.pgp file, and remove all...
authorJameson Rollins <jrollins@finestructure.net>
Tue, 19 Jan 2010 03:59:26 +0000 (22:59 -0500)
committerJameson Rollins <jrollins@finestructure.net>
Tue, 19 Jan 2010 03:59:26 +0000 (22:59 -0500)
packaging/debian/monkeysphere.postinst
src/transitions/0.28 [new file with mode: 0755]

index 4e811672cb7237ec9508c50a81819a863763c121..07bf468602c54146cc4f22bd0208e0317d50b8ce 100755 (executable)
@@ -22,7 +22,7 @@ case $1 in
        fi
 
        # try all available transitions:
-       for trans in 0.23 ; do
+       for trans in 0.23 0.28 ; do
            /usr/share/monkeysphere/transitions/$trans || { \
                RET=$?
                echo "Failed running transition script /usr/share/monkeysphere/transitions/$trans" >&2
diff --git a/src/transitions/0.28 b/src/transitions/0.28
new file mode 100755 (executable)
index 0000000..675f4f9
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# This is a post-install script for monkeysphere, to transition an old
+# (<0.28) setup to the new (>=0.28) setup.
+
+# You should be able to run this script after any version >= 0.23 is
+# installed.  This script should be well-behaved, even if it is run
+# repeatedly.
+
+# Written by
+# Jameson Rollins <jrollins@finestructure.net>
+# Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+#
+# Copyright 2010, released under the GPL, version 3 or later
+
+# any unexpected errors should cause this script to bail:
+set -e
+
+SYSDATADIR=${MONKEYSPHERE_SYSDATADIR:-"/var/lib/monkeysphere"}
+
+OLD_HOST_KEY_FILE="$SYSDATADIR"/ssh_host_rsa_key.pub.gpg
+if [ -f "$OLD_HOST_KEY_FILE" ] ; then
+    monkeysphere-host update-pgp-pub-file
+    rm -rf "$OLD_HOST_KEY_FILE"
+fi