chiark / gitweb /
doc: Document summary values of TOFU_STATS
[gnupg2.git] / tests / openpgp / mkdemodirs
1 #!/bin/sh
2
3 set -e
4
5 # We need to use --no-options so that a gpg.conf from an older version
6 # of gpg is not used.
7 GPG="../../g10/gpg --no-options --batch --quiet
8      --no-secmem-warning --allow-secret-key-import"
9
10 NAMES='Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India
11        Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo
12        Sierra Tango Uniform Victor Whisky XRay Yankee Zulu'
13
14 if [ "$1" = "--clean" ]; then
15     (for i in $NAMES; do
16         [ -d $i ] && rm -r $i
17     done) || true
18     exit 0
19 fi
20
21 $GPG --dearmor -o secdemo.gpg --yes ../checks/secdemo.asc
22 $GPG --dearmor -o pubdemo.gpg --yes ../checks/pubdemo.asc
23 [ -f ./tdb.tmp ] && rm ./tdb.tmp
24 GPGDEMO="$GPG --homedir . --trustdb-name ./tdb.tmp --no-default-keyring
25          --keyring pubdemo.gpg --secret-keyring secdemo.gpg"
26 echo -n "Creating:"
27 for name in $NAMES; do
28     echo -n " $name"
29     [ -d $name ] && rm -r $name
30     mkdir $name
31     $GPGDEMO --export-secret-key -o - $name > $name/Secret.gpg
32     $GPG --homedir $name --import $name/Secret.gpg
33     $GPGDEMO --export -o - $name > $name/Public.gpg
34     $GPG --homedir $name --import $name/Public.gpg
35     [ -f $name/pubring.gpg~ ] && rm $name/pubring.gpg~
36 done
37 echo "."
38 [ -f ./tdb.tmp ] && rm ./tdb.tmp
39 rm pubdemo.gpg secdemo.gpg
40
41