[Pgp-tools-commit] r67 - trunk/gpgsigs
Peter Palfrader
weasel at costa.debian.org
Sat Jun 18 16:52:46 UTC 2005
Author: weasel
Date: 2005-06-18 16:52:45 +0000 (Sat, 18 Jun 2005)
New Revision: 67
Modified:
trunk/gpgsigs/gpgsigs
Log:
A few more warns and dies on undefined values
Modified: trunk/gpgsigs/gpgsigs
===================================================================
--- trunk/gpgsigs/gpgsigs 2005-06-14 08:55:53 UTC (rev 66)
+++ trunk/gpgsigs/gpgsigs 2005-06-18 16:52:45 UTC (rev 67)
@@ -107,7 +107,9 @@
$rt->recode($text);
return $text;
} elsif (defined $it) {
- return $it->convert($text);
+ my $result = $it->convert($text);
+ warn ("Could not convert '$text'\n") unless defined $result;
+ return (defined $result) ? $result : $text
} else {
my $pid = open3(\*WTRFH, \*RDRFH, \*ERRFH, 'recode', "utf8..$charset");
print WTRFH $text;
@@ -117,8 +119,8 @@
close RDRFH;
close ERRFH;
waitpid $pid, 0;
- die ("'recode' failed, is it installed?\n") unless defined $result;
- return $result;
+ warn ("'recode' failed, is it installed?\n") unless defined $result;
+ return (defined $result) ? $result : $text
}
}
@@ -217,7 +219,7 @@
my ($key, $uid) = @_;
if (! defined $sigs->{$key}->{$uid}) {
warn "uid '$uid' not found on key $key";
- return;
+ return '(_)';
}
my $r = '(';
foreach my $mykey (@mykeys) {
@@ -241,13 +243,16 @@
if ( m/^pub +(?:\d+)[DR]\/([0-9A-F]{8}) [0-9]{4}-[0-9]{2}-[0-9]{2} *(.*)/ ) {
$key = $1;
$uid = $2;
- if ($uid) { # in gpg 1.2, the first uid is here
- print WRITE print_tag($key, $uid) . " $_";
- next;
- }
+ #if ($uid) { # in gpg 1.2, the first uid is here
+ # print WRITE print_tag($key, $uid) . " $_";
+ # next;
+ #}
}
if ( m/^uid +(.*)$/ ) {
$uid = $1;
+ die "key is undefined" unless defined $key;
+ die "uid is undefined, key $key" unless defined $uid;
+ die "bad tag from $key | $uid" unless defined (print_tag($key, $uid));
print WRITE print_tag($key, $uid) . " $_";
next;
}
More information about the Pgp-tools-commit
mailing list