summaryrefslogtreecommitdiff
path: root/debian/preinst
blob: 71dab99e481463e1b7110fa0bd49b35e3b213cbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh

set -e

case "$1" in
    upgrade|install)
	# Try to gracefully handle upgrades from a pre-0.3.3 version

	if [ ! -z $2 ]; then
	    set +e
	    dpkg --compare-versions $2 \<= 0.3.2-1
	    result=$?
	    set -e
	    if [ $result = 0 ]; then
		cat <<EOF
Due to a bug in the way secret keys were encrypted in versions prior
to 0.3.3, this version of gnupg is not backwards compatible with $2
which you have (had) installed on your system.  

There is an upgrade strategy (see /usr/doc/gnupg/NEWS.gz after this
version is installed), but it requires an old copy of the gpg and gpgm
EOF
		echo -n "binaries; shall I make copies of them for you (Y/n)? "
		read answer
		if [ ! "$answer" = "n" ] && [ ! "$answer" = "N" ]; then
		    cp /usr/bin/gpg /usr/bin/gpg.old
		    cp /usr/bin/gpgm /usr/bin/gpgm.old
		    echo "Okay, done.  The old versions are /usr/bin/gpg*.old"
		else
		    echo "Okay, I haven't made backups."
		fi;	
		cat <<EOF

If at any stage you need a pre-0.3.3 gnupg, you can find source and
binaries for i386, m68k, alpha, powerpc and hurd-i386 at 

   http://people.debian.org/~troup/gnupg/

Press return to continue
EOF
		read foo
	    fi;
	fi;
	;;
    abort-upgrade)
	;;
esac