Fixed EOF detection for encrypted packets.
[gnupg.git] / tools / pgpgroup-to-gpggroup
blobdbf854c9e0b5ed62ad6c72aaad96aaf297683a89
1 #!/usr/bin/perl -w
3 # pgpgroup-to-gpggroup - convert PGP groups to GnuPG groups
4 # Copyright (C) 2004 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18 # This program requires a PGP command line program that supports
19 # groups (note that the PGP 8 command line doesn't).
21 $pgp="pgp -gvv 2>/dev/null";
23 open(PGP,"$pgp|") || die "Unable to call PGP: $!";
25 while(<PGP>)
27 # If the line begins with a ">", then it is a new group.
29 if(/^ > (\S+)/)
31 print "\ngroup $1 = ";
33 elsif(/\s+(0x\S+)/)
35 print "$1 ";
39 print "\n";
40 close(PGP);