to find signed-by value, run gpg on the individual keys to print better error messages in case it fails (gpg doesn't give an indication which file it was unable to read) and print progress bar
This commit is contained in:
parent
ea2b57870b
commit
c682a61468
1 changed files with 12 additions and 6 deletions
18
mmdebstrap
18
mmdebstrap
|
@ -5213,9 +5213,13 @@ sub main() {
|
||||||
$signedby = " [signed-by=\"$keyring\"]";
|
$signedby = " [signed-by=\"$keyring\"]";
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
{
|
info "Finding correct signed-by value...";
|
||||||
open(my $fh, '-|', @gpgcmd, '--with-colons', '--show-keys',
|
my $progress = 0.0;
|
||||||
@keyrings) // error "failed to fork(): $!";
|
print_progress($progress);
|
||||||
|
for (my $i = 0 ; $i < scalar @keyrings ; $i++) {
|
||||||
|
my $k = $keyrings[$i];
|
||||||
|
open(my $fh, '-|', @gpgcmd, '--with-colons',
|
||||||
|
'--show-keys', $k) // error "failed to fork(): $!";
|
||||||
while (my $line = <$fh>) {
|
while (my $line = <$fh>) {
|
||||||
if ($line !~ /^fpr:::::::::([^:]+):/) {
|
if ($line !~ /^fpr:::::::::([^:]+):/) {
|
||||||
next;
|
next;
|
||||||
|
@ -5223,10 +5227,12 @@ sub main() {
|
||||||
push @aptfingerprints, $1;
|
push @aptfingerprints, $1;
|
||||||
}
|
}
|
||||||
close $fh;
|
close $fh;
|
||||||
|
if ($? != 0) {
|
||||||
|
warning("gpg failed to read $k");
|
||||||
|
}
|
||||||
|
print_progress($i / (scalar @keyrings) * 100.0, undef);
|
||||||
}
|
}
|
||||||
if ($? != 0) {
|
print_progress("done");
|
||||||
error "gpg failed";
|
|
||||||
}
|
|
||||||
if (scalar @aptfingerprints == 0) {
|
if (scalar @aptfingerprints == 0) {
|
||||||
$signedby = " [signed-by=\"$keyring\"]";
|
$signedby = " [signed-by=\"$keyring\"]";
|
||||||
last;
|
last;
|
||||||
|
|
Loading…
Reference in a new issue