summaryrefslogtreecommitdiffstats
path: root/scripts/parse-gpg-update
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 14:25:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 14:25:47 +0000
commit4ed1a6e1d4fcb1ba272a4fb3931b33d1c6fbee0d (patch)
tree26048107dbe7d72d60d9339d90f5cfe678937863 /scripts/parse-gpg-update
parentInitial commit. (diff)
downloaddebian-keyring-4ed1a6e1d4fcb1ba272a4fb3931b33d1c6fbee0d.tar.xz
debian-keyring-4ed1a6e1d4fcb1ba272a4fb3931b33d1c6fbee0d.zip
Adding upstream version 2023.12.24.upstream/2023.12.24
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/parse-gpg-update')
-rwxr-xr-xscripts/parse-gpg-update52
1 files changed, 52 insertions, 0 deletions
diff --git a/scripts/parse-gpg-update b/scripts/parse-gpg-update
new file mode 100755
index 0000000..844083e
--- /dev/null
+++ b/scripts/parse-gpg-update
@@ -0,0 +1,52 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use DB_File;
+
+my %ident;
+
+if ($#ARGV != 0 and $#ARGV != 1) {
+ print "Must supply key id.\n";
+ exit 1;
+}
+
+open KEYIDS, "<keyids" or die "Can't open keyids file: $!";
+while (<KEYIDS>) {
+ chomp;
+ /^0x([^ ]*) (.*)/;
+ $ident{$1} = $2;
+}
+close KEYIDS;
+
+$ARGV[0] =~ s/0x//;
+
+my $keyid = $ARGV[0];
+my $user;
+if (! defined($ident{$ARGV[0]})) {
+ if ($#ARGV == 1) {
+ $user = $ARGV[1] . " [DM]";
+ } else {
+ $user = "UNKNOWN (DM?)";
+ }
+} else {
+ $user = $ident{$ARGV[0]};
+}
+
+my ($uids, $subs, $sigs) = (0, 0, 0);
+while (<STDIN>) {
+ if (/new subkeys: (\d+)$/) {
+ $subs = $1;
+ } elsif (/new user IDs: (\d+)$/) {
+ $uids = $1;
+ } elsif (/new signatures: (\d+)$/) {
+ $sigs = $1;
+ }
+}
+
+print "0x$keyid $user";
+print " uid:$uids" if ($uids > 0);
+print " sub:$subs" if ($subs > 0);
+print " sig:$sigs" if ($sigs > 0);
+print "\n";