summaryrefslogtreecommitdiffstats
path: root/debian/tests/migration
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:14:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:14:08 +0000
commitafd7a175b53248d68095cecf5616705d093ffbc9 (patch)
tree5678015e96cc82aac7cf90a0b967aaea7a1c0841 /debian/tests/migration
parentAdding upstream version 2.2.40. (diff)
downloadgnupg2-debian/2.2.40-1.1.tar.xz
gnupg2-debian/2.2.40-1.1.zip
Adding debian version 2.2.40-1.1.debian/2.2.40-1.1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/migration')
-rwxr-xr-xdebian/tests/migration22
1 files changed, 22 insertions, 0 deletions
diff --git a/debian/tests/migration b/debian/tests/migration
new file mode 100755
index 0000000..2179e65
--- /dev/null
+++ b/debian/tests/migration
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+set -x
+
+DIR=$(mktemp -d)
+GPG_HOME="$DIR/gnupg"
+gpg=(gpg --homedir "$GPG_HOME" --batch --quiet --with-colons)
+gpg1=(gpg1 --homedir "$GPG_HOME" --batch --quiet --with-colons)
+
+mkdir "$GPG_HOME"
+chmod 700 "$GPG_HOME"
+
+cat $(ls /usr/share/keyrings/debian-archive-*.gpg \
+ | grep -vE 'debian-archive-bookworm-stable.gpg|debian-archive-keyring.gpg') \
+ | "${gpg1[@]}" --import
+"${gpg1[@]}" --list-keys
+"${gpg[@]}" --list-keys > "$DIR/key.list.before"
+migrate-pubring-from-classic-gpg "$GPG_HOME"
+"${gpg[@]}" --list-keys > "$DIR/key.list.after"
+
+diff -u "$DIR/key.list.before" "$DIR/key.list.after"