Commit 64328256 authored by intrigeri's avatar intrigeri
Browse files

Upgrader: log GnuPG's exit code, stdout, and stderr when signature verification fails

parent c1b6c2f0
......@@ -30,6 +30,7 @@ use Filesys::Df;
use Function::Parameters;
use IPC::System::Simple qw{capturex};
use Path::Tiny;
use String::Errf qw{errf};
use Types::Path::Tiny qw{AbsDir AbsFile Path};
use Types::Standard qw{Str};
......@@ -139,6 +140,18 @@ fun verify_signature (Str $txt,
);
waitpid $pid, 0;
$CHILD_ERROR == 0 or say STDERR errf(
"GnuPG signature verification failed:\n".
"exit code: %{exit_code}i\n\n".
"stdout:\n%{stdout}s\n\n".
"stderr:\n%{stderr}s",
{
exit_code => $CHILD_ERROR,
stdout => join('', $stdout->getlines),
stderr => join('', $stderr->getlines),
}
);
return $CHILD_ERROR == 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment