diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 14:25:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 14:25:47 +0000 |
commit | 4ed1a6e1d4fcb1ba272a4fb3931b33d1c6fbee0d (patch) | |
tree | 26048107dbe7d72d60d9339d90f5cfe678937863 /t/dm-vs-dd.t | |
parent | Initial commit. (diff) | |
download | debian-keyring-01898be3cb7227e155cabd182a7a93b81f0fb1e7.tar.xz debian-keyring-01898be3cb7227e155cabd182a7a93b81f0fb1e7.zip |
Adding upstream version 2023.12.24.upstream/2023.12.24
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | t/dm-vs-dd.t | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/t/dm-vs-dd.t b/t/dm-vs-dd.t new file mode 100755 index 0000000..6b1a99c --- /dev/null +++ b/t/dm-vs-dd.t @@ -0,0 +1,47 @@ +#!/bin/sh +# Compares the DM keyring with the DD keyring. If the same name or email is +# in both keyrings, that's an error. +set -e + +list_uids () { + gpg --no-options --no-auto-check-trustdb --no-default-keyring \ + --keyring "$1" --list-keys | grep -a '^uid' | sed 's/^uid *//' | + egrep -a -v '\[jpeg image of size .*\]' +} + +list_names () { + sed 's/ <.*>//' +} + +list_emails () { + sed 's/.* <\(.*\)>/\1/' +} + +fail=0 + +dd_uids=$(list_uids ./output/keyrings/debian-keyring.gpg) +( + echo "$dd_uids" | list_emails + echo "$dd_uids" | list_names + echo "$dd_uids" +) | sort | uniq > dd-list.tmp + +IFS=" +" +for uid in $(list_uids ./output/keyrings/debian-maintainers.gpg | sort | uniq); do + name=$(echo "$uid" | list_names) + email=$(echo "$uid" | list_emails) + if grep -a -q "^$uid$" dd-list.tmp; then + echo "$uid is in both the DD and DM keyrings" + fail=1 + elif grep -a "^$name$" dd-list.tmp; then + echo "warning: name $name is in both the DD and DM keyrings" + elif grep -a "^$email$" dd-list.tmp; then + echo "email $email is in both the DD and DM keyrings" + fail=1 + fi +done + +rm -f dd-list.tmp + +exit $fail |