home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / gnupg.preinst < prev    next >
Encoding:
Text File  |  2007-03-07  |  1.2 KB  |  48 lines

  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" ] && [ ! "$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
  48.