From a27c8b00ebf173659f22f53ce65679e94e7dfb1b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:19:41 +0200 Subject: Adding upstream version 2022.12.24. Signed-off-by: Daniel Baumann --- scripts/parse-gpg-update | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 scripts/parse-gpg-update (limited to 'scripts/parse-gpg-update') 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, ") { + 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 () { + 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"; -- cgit v1.2.3