~ubuntu-branches/ubuntu/precise/gnupg2/precise-proposed

« back to all changes in this revision

Viewing changes to debian/preinst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2006-01-24 04:31:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060124043142-pbg192or6qxv3yk2
Tags: 1.9.20-1
* New Upstream version. Closes:#306890,#344530
  * Closes:#320490: gpg-protect-tool fails to decrypt PKCS-12 files 
* Depend on libopensc2-dev, not -1-. Closes:#348106

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
set -e
 
4
 
 
5
case "$1" in
 
6
    upgrade|install)
 
7
        # Try to gracefully handle upgrades from a pre-0.3.3 version
 
8
 
 
9
        if [ ! -z $2 ]; then
 
10
            set +e
 
11
            dpkg --compare-versions $2 \<= 0.3.2-1
 
12
            result=$?
 
13
            set -e
 
14
            if [ $result = 0 ]; then
 
15
                cat <<EOF
 
16
Due to a bug in the way secret keys were encrypted in versions prior
 
17
to 0.3.3, this version of gnupg is not backwards compatible with $2
 
18
which you have (had) installed on your system.  
 
19
 
 
20
There is an upgrade strategy (see /usr/doc/gnupg/NEWS.gz after this
 
21
version is installed), but it requires an old copy of the gpg and gpgm
 
22
EOF
 
23
                echo -n "binaries; shall I make copies of them for you (Y/n)? "
 
24
                read answer
 
25
                if [ ! "$answer" = "n" -a ! "$answer" = "N" ]; then
 
26
                    cp /usr/bin/gpg /usr/bin/gpg.old
 
27
                    cp /usr/bin/gpgm /usr/bin/gpgm.old
 
28
                    echo "Okay, done.  The old versions are /usr/bin/gpg*.old"
 
29
                else
 
30
                    echo "Okay, I haven't made backups."
 
31
                fi;     
 
32
                cat <<EOF
 
33
 
 
34
If at any stage you need a pre-0.3.3 gnupg, you can find source and
 
35
binaries for i386, m68k, alpha, powerpc and hurd-i386 at 
 
36
 
 
37
   http://people.debian.org/~troup/gnupg/
 
38
 
 
39
Press return to continue
 
40
EOF
 
41
                read foo
 
42
            fi;
 
43
        fi;
 
44
        ;;
 
45
    abort-upgrade)
 
46
        ;;
 
47
esac