summaryrefslogtreecommitdiffstats
path: root/tests/openpgp/mkdemodirs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:14:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:14:06 +0000
commiteee068778cb28ecf3c14e1bf843a95547d72c42d (patch)
tree0e07b30ddc5ea579d682d5dbe57998200d1c9ab7 /tests/openpgp/mkdemodirs
parentInitial commit. (diff)
downloadgnupg2-eee068778cb28ecf3c14e1bf843a95547d72c42d.tar.xz
gnupg2-eee068778cb28ecf3c14e1bf843a95547d72c42d.zip
Adding upstream version 2.2.40.upstream/2.2.40upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/openpgp/mkdemodirs')
-rwxr-xr-xtests/openpgp/mkdemodirs41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/openpgp/mkdemodirs b/tests/openpgp/mkdemodirs
new file mode 100755
index 0000000..fd8a741
--- /dev/null
+++ b/tests/openpgp/mkdemodirs
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+# We need to use --no-options so that a gpg.conf from an older version
+# of gpg is not used.
+GPG="../../g10/gpg --no-options --batch --quiet
+ --no-secmem-warning --allow-secret-key-import"
+
+NAMES='Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India
+ Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo
+ Sierra Tango Uniform Victor Whisky XRay Yankee Zulu'
+
+if [ "$1" = "--clean" ]; then
+ (for i in $NAMES; do
+ [ -d $i ] && rm -r $i
+ done) || true
+ exit 0
+fi
+
+$GPG --dearmor -o secdemo.gpg --yes ../checks/secdemo.asc
+$GPG --dearmor -o pubdemo.gpg --yes ../checks/pubdemo.asc
+[ -f ./tdb.tmp ] && rm ./tdb.tmp
+GPGDEMO="$GPG --homedir . --trustdb-name ./tdb.tmp --no-default-keyring
+ --keyring pubdemo.gpg --secret-keyring secdemo.gpg"
+echo -n "Creating:"
+for name in $NAMES; do
+ echo -n " $name"
+ [ -d $name ] && rm -r $name
+ mkdir $name
+ $GPGDEMO --export-secret-key -o - $name > $name/Secret.gpg
+ $GPG --homedir $name --import $name/Secret.gpg
+ $GPGDEMO --export -o - $name > $name/Public.gpg
+ $GPG --homedir $name --import $name/Public.gpg
+ [ -f $name/pubring.gpg~ ] && rm $name/pubring.gpg~
+done
+echo "."
+[ -f ./tdb.tmp ] && rm ./tdb.tmp
+rm pubdemo.gpg secdemo.gpg
+
+