diff options
author | agc <agc@pkgsrc.org> | 2005-03-03 22:43:49 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 2005-03-03 22:43:49 +0000 |
commit | 9fcba1c4687ddeef051c0a7f2b435cf0649a9eec (patch) | |
tree | 1fee601aa6ad00ffdd055eab618f798b0557f952 /security | |
parent | 3f735beba0458f5249aa41c6c6f2680577a67502 (diff) | |
download | pkgsrc-9fcba1c4687ddeef051c0a7f2b435cf0649a9eec.tar.gz |
Update gpg2dot to version 1.4.
Fixes from Christoph Badura, who tested on gnupg-1.2.
This new version works with gnupg-1.4.0 as well as older versions of gpg,
and uses the --list-sigs argument as well as the --with-colons arguments
to gpg.
Diffstat (limited to 'security')
-rw-r--r-- | security/gpg2dot/Makefile | 6 | ||||
-rw-r--r-- | security/gpg2dot/files/gpg2dot.pl | 23 |
2 files changed, 15 insertions, 14 deletions
diff --git a/security/gpg2dot/Makefile b/security/gpg2dot/Makefile index 0a1839ffb53..60d0ce49572 100644 --- a/security/gpg2dot/Makefile +++ b/security/gpg2dot/Makefile @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.4 2004/04/04 22:16:59 hubertf Exp $ +# $NetBSD: Makefile,v 1.5 2005/03/03 22:43:49 agc Exp $ # -DISTNAME= gpg2dot-1.3 -WRKSRC= ${WRKDIR} +DISTNAME= gpg2dot-1.4 CATEGORIES= security MASTER_SITES= # empty DISTFILES= # empty @@ -19,6 +18,7 @@ NO_CHECKSUM= yes NO_CONFIGURE= yes DISTVER= ${DISTNAME:S/gpg2dot-//} +WRKSRC= ${WRKDIR} .include "../../mk/bsd.prefs.mk" diff --git a/security/gpg2dot/files/gpg2dot.pl b/security/gpg2dot/files/gpg2dot.pl index 213e23907f1..58dfe9e2a28 100644 --- a/security/gpg2dot/files/gpg2dot.pl +++ b/security/gpg2dot/files/gpg2dot.pl @@ -1,6 +1,6 @@ -#!@PREFIX@/bin/perl +#! @PREFIX@/bin/perl # -# $NetBSD: gpg2dot.pl,v 1.3 2004/04/04 22:16:59 hubertf Exp $ +# $NetBSD: gpg2dot.pl,v 1.4 2005/03/03 22:43:49 agc Exp $ # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): @@ -20,26 +20,27 @@ $date = localtime(); $mykeyid = shift; -$sg = ""; -open(GPG, "gpg --list-keys --verbose 2>/dev/null |"); +open(GPG, "gpg --list-sigs --with-colons --no-sig-cache --verbose 2>/dev/null |"); while (<GPG>) { chomp; - if (/^(pub) +(\S+)\s+(\S+)\s+(.+\S)/ || - /^(uid) +\s+(.+\S)/) { - if ($1 eq "pub") { - ($lkeyid, $date, $kuid) = ($2, $3, $4); + my @fields = split /:/; + if ($fields[0] eq "pub" || $fields[0] eq "uid") { + if ($fields[0] eq "pub") { + ($lkeyid, $date, $kuid) = ($fields[4], $fields[5], $fields[9]); } else { - ($kuid) = ($2); + next; # XXX --with-colons doesn't seem to produce uid records with useable values + ($kuid) = ($fields[$9]); } $kuid =~ s/\"/\\\"/g; + $kuid =~ s/\\x([0-9a-fA-F]+)/chr(hex($1))/eg; ($keyid = $lkeyid) =~ s:.*/::; $kuid{$keyid} = $kuid; next if ($label{$keyid} != ""); $label{$keyid} = "$lkeyid - $date\\n$kuid"; } - elsif (/^sig (.{7}) (\S+)\s+(\S+)\s+(.+\S)/) { - ($skeyid, $date, $suid) = ($2, $3, $4); + elsif ($fields[0] eq "sig") { + ($skeyid, $date, $suid) = ($fields[4], $fields[5], $fields[9]); next if ($suid =~ /id not found/ || $skeyid eq $keyid); push(@isigs, "$keyid $skeyid $date $suid"); |