summaryrefslogtreecommitdiffstats
path: root/scripts/parse-gpg-update
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:19:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:19:41 +0000
commita27c8b00ebf173659f22f53ce65679e94e7dfb1b (patch)
tree02c68ec259348b63c6328896aa73265eb7b3d730 /scripts/parse-gpg-update
parentInitial commit. (diff)
downloaddebian-keyring-a27c8b00ebf173659f22f53ce65679e94e7dfb1b.tar.xz
debian-keyring-a27c8b00ebf173659f22f53ce65679e94e7dfb1b.zip
Adding upstream version 2022.12.24.upstream/2022.12.24upstream
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";