handle revoked uids in perl to get linecount right
[pgp-tools.git] / gpg-key2ps / gpg-key2ps
index 5b875856fd6d09b102f04db3a06790627001a374..9498e6b04bac513d23f262e80353efb99b0be9cb 100755 (executable)
@@ -165,8 +165,6 @@ if ( $revokestyle eq "grey" ) {
        print " uid\n";
        print " 0 setgray\n";
        print "} def\n";
-} elsif ( $revokestyle eq "hide" ) {
-       print "/revuid {} def\n";
 } elsif ( $revokestyle eq "note" ) {
        print "/revuid {\n";
        print " 50 y moveto (uid) show\n";
@@ -223,7 +221,9 @@ while(<GPG>) {
        # user ids
        s/^uid:[^:r]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:([^:]*):.*/     ($1) uid/;
        # revoked user id
-       s/^uid:r[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:([^:]*):.*/     ($1) revuid/;
+       if (s/^uid:r[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:([^:]*):.*/ ($1) revuid/) {
+               next if $revokestyle eq "hide";
+       }
        # subkey
        s/^sub:[^:]*:([^:]*):([0-9]*):.{8,8}(.{8,8}):([^:]*):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:.*/    ($4) ($3) $2 ($1) sbk/;
        $numlines++;
@@ -237,6 +237,8 @@ unless ($started) {
        exit 1;
 }
 
+print STDERR "numlines $numlines\n";
+
 # output the remaining postscript
 print <<EOF;
 } def