From d8b810fb27f7bbe6cdf6192ddf3c1449040ca4a2e72fb39f01865b688aa8d107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 19 Sep 2008 07:41:26 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/suse-build-key?expand=0&rev=11 --- dumpsigs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 dumpsigs diff --git a/dumpsigs b/dumpsigs new file mode 100644 index 0000000..87ee3a6 --- /dev/null +++ b/dumpsigs @@ -0,0 +1,42 @@ +#!/usr/bin/perl + +my $keyring=''; + +$keyring="--no-default-keyring --keyring=$ARGV[0]" if $ARGV[0] ne ''; + +my @line; +my $ver; +my $rel; +my $name; + +open(GPG, "gpg $keyring --no-secmem-warning --list-sigs --list-options show-keyring --fixed-list-mode --with-colons |"); +while () { + chomp; + next unless /^pub:/; + @line = split(':', $_); + my $id = $line[4]; + $_ = ; + chomp; + next unless /^uid:/; + @line = split(':', $_); + $name = $line[9]; + while (1) { + $_ = ; + chomp; + die unless /^sig:/; + @line = split(':', $_); + next if $line[4] ne $id; + $ver = lc($id); + $ver =~ s/.*(........)$/$1/; + $rel = sprintf("%08x", $line[5]); + last; + } + $names{"gpg-pubkey-$ver-$rel"} = $id; +} +close GPG; +my $n; + +for $n (sort keys %names) { + print "writing $n.asc\n"; + system("gpg $keyring --no-secmem-warning --export -a '$names{$n}' >$n.asc"); +}