~ubuntu-branches/ubuntu/karmic/signing-party/karmic

« back to all changes in this revision

Viewing changes to gpg-key2ps/gpg-key2ps

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2009-02-23 21:37:20 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090223213720-98hkq51ynr3oaic7
Tags: 1.1-2
Fix build error when only building the binary package
by fixing the build-arch target (Closes: #516804).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
# gpg-key2ps: convert a PGP/GnuPG key into paper slips.
4
4
# Copyright (C) 2001-2005  Simon Richter
5
 
# Copyright (C) 2005-2007  Thijs Kinkhorst
 
5
# Copyright (C) 2005-2008  Thijs Kinkhorst
6
6
# Copyright (C) 2005-2008  Christoph Berg <cb@df7cb.de>
7
7
# Licenced under the GNU General Public License,
8
8
# version 2 or later.
9
9
#
10
 
# $Id: gpg-key2ps 372 2008-03-16 18:41:31Z myon $
 
10
# $Id: gpg-key2ps 393 2008-07-19 08:04:08Z thijs $
11
11
 
12
12
use strict;
13
13
use Getopt::Long;
14
14
 
15
 
my $version = '$Rev: 372 $';
 
15
my $version = '$Rev: 393 $';
16
16
$version =~ s/\$Rev:\s*(\d+)\s*\$/$1/;
 
17
my $showsubkeys = 0;
17
18
my $revokestyle = "hide";
18
19
my $columns = 2;
19
20
my $creationdate = scalar(localtime);
27
28
        my ($fd, $exitcode) = @_;
28
29
        version ($fd);
29
30
        print $fd <<EOF;
30
 
Usage: $0 [-p papersize] [-r revoked-style] [-1] keyid-or-name ...
 
31
Usage: $0 [-p papersize] [-r revoked-style] [-1] [-s] keyid-or-name ...
31
32
Options:
32
33
 -p --paper-size
 
34
 -s --show-subkeys
33
35
 -r --revoked-style
34
36
        hide   - Don't show revoked uids and subkeys (default)
35
37
        grey   - Print text in grey
51
53
        '--help'            => \$opts->{help},
52
54
        '-v'                => \$opts->{version},
53
55
        '--version'         => \$opts->{version},
 
56
        '-s'                => \$opts->{showsubkeys},
 
57
        '--show-subkeys'    => \$opts->{showsubkeys},
54
58
        '-p=s'              => \$opts->{papersize},
55
59
        '--paper-size=s'    => \$opts->{papersize},
56
60
        '-r=s'              => \$opts->{revokestyle},
69
73
        exit 0;
70
74
}
71
75
 
 
76
if ( $opts->{papersize} ) { $ENV{'PAPERSIZE'} = $opts->{papersize}; }
 
77
if ( $opts->{showsubkeys} ) { $showsubkeys = 1; }
72
78
if ( $opts->{revokestyle} ) { $revokestyle = $opts->{revokestyle}; }
73
 
if ( $opts->{papersize} ) { $ENV{'PAPERSIZE'} = $opts->{papersize}; }
74
79
 
75
80
if ( $revokestyle !~ /^(grey|hide|note|show|strike)$/ ) {
76
81
        print STDERR "Unknown revoked-style \"$revokestyle\".\n";
247
252
                $_ = "  ($fpr) fpr\n";
248
253
        }
249
254
        # user ids
 
255
        s/\\x([0-9a-f][0-9a-f])/ chr(hex($1)) /gie;
 
256
        $_ = `echo "$_" | iconv -ct latin1`;
250
257
        s/^uid:[^:r]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:([^:]*):.*/     ($1) uid/;
251
258
        # revoked user id
252
259
        if (s/^uid:r[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:([^:]*):.*/ ($1) revuid/) {
253
260
                next if $revokestyle eq "hide";
254
261
        }
255
262
        # subkey
256
 
        s/^sub:[^r:]*:([^:]*):([0-9]*):.{8,8}(.{8,8}):([^:]*):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:.*/   ($4) ($3) $2 ($1) sbk/;
 
263
        if (s/^sub:[^r:]*:([^:]*):([0-9]*):.{8,8}(.{8,8}):([^:]*):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:.*/       ($4) ($3) $2 ($1) sbk/) {
 
264
                next if ! $showsubkeys;
 
265
        }
257
266
        if (s/^sub:r[^:]*:([^:]*):([0-9]*):.{8,8}(.{8,8}):([^:]*):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:.*/       ($4) ($3) $2 ($1) revsbk/) {
258
 
                next if $revokestyle eq "hide";
 
267
                next if (!$showsubkeys) || $revokestyle eq "hide";
259
268
        }
260
269
        $numlines++;
261
270
        # print this line
321
330
 
322
331
=head1 SYNOPSIS
323
332
 
324
 
B<gpg-key2ps> [B<-r> I<revoked-style>] [B<-p> I<papersize>] I<keyid-or-name> [ I<...> ]
 
333
B<gpg-key2ps> [B<-r> I<revoked-style>] [B<-p> I<papersize>] [B<-1>] [B<-s>] I<keyid-or-name> [ I<...> ]
325
334
 
326
335
=head1 DESCRIPTION
327
336
 
339
348
Select the output paper size. Default is to look into /etc/papersize or A4 if
340
349
libpaper isn't installed.
341
350
 
 
351
=item B<-s> B<--show-subkeys>
 
352
 
 
353
Enable subkey information to be printed on the slips. Subkey information is
 
354
normally not relevant to the key signing process.
 
355
 
342
356
=item B<-r> B<--revoked-style> I<revoked-style>
343
357
 
344
358
Select how to mark revoked UIDs and subkeys. Five styles are available:
348
362
 B<note> add "[revoked]", and
349
363
 B<strike> strike through.
350
364
 
 
365
=item B<-1>
 
366
 
 
367
Print only one column of paper slips instead of the default two. Useful for keys
 
368
with long UIDs that otherwise won't fit.
 
369
 
351
370
=item I<keyid>
352
371
 
353
372
Keyids to print. Multiple can be separated by spaces.
388
407
 
389
408
=item (c) 2001-2005 Simon Richter <sjr@debian.org>
390
409
 
391
 
=item (c) 2005-2007 Thijs Kinkhorst <thijs@kinkhorst.com>
 
410
=item (c) 2005-2008 Thijs Kinkhorst <thijs@kinkhorst.com>
392
411
 
393
412
=item (c) 2005-2008 Christoph Berg <cb@df7cb.de>
394
413