gpg: adjust command line

This commit is contained in:
Konstantin Demin 2021-05-09 23:31:05 +03:00
parent 88a031477a
commit 7cf91eeda6
Signed by: rockdrilla
GPG key ID: 1F33CB0BA4731BC6

View file

@ -4950,12 +4950,14 @@ sub main() {
TMPDIR => 1,
CLEANUP => 1
);
my @gpgcmd = (
'gpg', '--quiet',
'--ignore-time-conflict', '--no-options',
'--no-default-keyring', '--homedir',
$gpghome, '--no-auto-check-trustdb',
'--trust-model', 'always'
my @gpgcmd_base = (
'gpg', '--quiet', '--ignore-time-conflict', '--no-options',
'--no-default-keyring', '--homedir', $gpghome
);
my @gpgcmd_enum = (
'--no-auto-check-trustdb', '--trust-model',
'always', '--with-colons',
'--show-keys'
);
my ($ret, $message);
{
@ -4964,7 +4966,7 @@ sub main() {
# change warning handler to prevent message
# Can't exec "gpg": No such file or directory
local $SIG{__WARN__} = sub { $message = shift; };
$ret = open $fh, '-|', @gpgcmd, '--version';
$ret = open $fh, '-|', @gpgcmd_base, '--version';
}
# we only want to check if the gpg command exists
close $fh;
@ -4976,7 +4978,7 @@ sub main() {
}
# initialize gpg trustdb with empty one
{
`@gpgcmd --update-trustdb >/dev/null 2>/dev/null`;
`@gpgcmd_base --update-trustdb >/dev/null 2>/dev/null`;
$? == 0 or error "gpg failed to initialize trustdb: $?";
}
# find all the fingerprints of the keys apt currently
@ -5003,8 +5005,8 @@ sub main() {
last;
}
{
open(my $fh, '-|', @gpgcmd, '--with-colons', '--show-keys',
@keyrings) // error "failed to fork(): $!";
open(my $fh, '-|', @gpgcmd_base, @gpgcmd_enum, @keyrings)
// error "failed to fork(): $!";
while (my $line = <$fh>) {
if ($line !~ /^fpr:::::::::([^:]+):/) {
next;
@ -5025,8 +5027,8 @@ sub main() {
# the case
my @suitefingerprints = ();
{
open(my $fh, '-|', @gpgcmd, '--with-colons', '--show-keys',
$keyring) // error "failed to fork(): $!";
open(my $fh, '-|', @gpgcmd_base, @gpgcmd_enum, $keyring)
// error "failed to fork(): $!";
while (my $line = <$fh>) {
if ($line !~ /^fpr:::::::::([^:]+):/) {
next;