chiark / gitweb /
gnupg2 (2.1.17-3) unstable; urgency=medium
[gnupg2.git] / tools / convert-from-106
1 #!/bin/sh
2 # Copyright (C) 2002, 2004 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, see <http://www.gnu.org/licenses/>.
16 if ! gpg --version > /dev/null 2>&1 ; then
17    echo "GnuPG not available!"
18    exit 1
19 fi
20
21 gpg="gpg --no-greeting --no-secmem-warning"
22
23 echo "This script converts your public keyring and trustdb from GnuPG"
24 echo "1.0.6 or earlier to the 1.0.7 and later format."
25
26 echo "If you have already done this, there is no harm (but no point)"
27 echo "in doing it again."
28
29 echo -n "Continue? (y/N)"
30
31 read answer
32
33 if test "x$answer" != "xy" ; then
34   exit 0
35 fi
36
37 echo
38 echo "Marking your keys as ultimately trusted"
39 for key in `$gpg --with-colons --list-secret-keys | grep sec: | cut -d: -f5`
40 do
41   $gpg --trusted-key $key --with-colons --list-keys $key > /dev/null 2>&1
42   echo -n "."
43 done
44 echo
45
46 echo
47 echo "Adding signature caches"
48 $gpg --rebuild-keydb-caches
49
50 echo
51 echo "Checking trustdb"
52 $gpg --check-trustdb
53
54 echo
55 echo "Done!"