X-Git-Url: http://git.sthu.org/?a=blobdiff_plain;f=caff%2Fcaff;h=084b41c0bfc419cfe0569f66fc5c7e30fdde5703;hb=8c0fcf1176d2fee59f3d469c909c4c34401d7e37;hp=4eb9083a4ad564eb45c2196922ec8ef36692dac4;hpb=121dc74316a9041364ea987a7627542993681b1a;p=pgp-tools.git diff --git a/caff/caff b/caff/caff index 4eb9083..084b41c 100755 --- a/caff/caff +++ b/caff/caff @@ -518,21 +518,34 @@ if ($CONFIG{'no-download'}) { $gpg->options->meta_interactive( 0 ); my ($inputfd, $stdoutfd, $stderrfd, $statusfd, $handles) = make_gpg_fds(); - my $pid = $gpg->recv_keys(handles => $handles, command_args => [ @KEYIDS ]); - my ($stdout, $stderr, $status) = readwrite_gpg('', $inputfd, $stdoutfd, $stderrfd, $statusfd); - waitpid $pid, 0; + my @local_keyids = @KEYIDS; + for my $keyid (@local_keyids) { + info ("fetching $keyid..."); + my $pid = $gpg->recv_keys(handles => $handles, command_args => [ $keyid ]); + my ($stdout, $stderr, $status) = readwrite_gpg('', $inputfd, $stdoutfd, $stderrfd, $statusfd); + waitpid $pid, 0; # [GNUPG:] IMPORT_OK 0 5B00C96D5D54AEE1206BAF84DE7AAF6E94C09C7F # [GNUPG:] NODATA 1 # [GNUPG:] NODATA 1 # [GNUPG:] IMPORT_OK 0 25FC1614B8F87B52FF2F99B962AF4031C82E0039 - for my $line (split /\n/, $status) { - if ($line =~ /^\[GNUPG:\] IMPORT_OK/) { - push @keyids_ok, shift @KEYIDS; - } elsif ($line =~ /^\[GNUPG:\] NODATA/) { + my $handled = 0; + for my $line (split /\n/, $status) { + if ($line =~ /^\[GNUPG:\] IMPORT_OK/) { + push @keyids_ok, shift @KEYIDS; + $handled = 1; + last; + } elsif ($line =~ /^\[GNUPG:\] NODATA/) { + push @keyids_failed, shift @KEYIDS; + $handled = 1; + last; + }; + }; + unless ($handled) { + notice ("Huh, what's up with $keyid?"); push @keyids_failed, shift @KEYIDS; }; - } + }; die ("Still keys in \@KEYIDS. This should not happen.") if scalar @KEYIDS; notice ("Import failed for: ". (join ' ', @keyids_failed).".") if scalar @keyids_failed; };