[Bps-public-commit] GnuPG-Interface branch, work-with-both-gnupgs, updated. 0.52-28-gd39f811
Brian Duggan
brian at bestpractical.com
Wed Mar 28 15:54:11 EDT 2018
The branch, work-with-both-gnupgs has been updated
via d39f8114e44dbc667f8121c1fe1a00d03b8e497c (commit)
from 9c5f9d4b99c031840606322e07ebc0775af5918f (commit)
Summary of changes:
t/zzz_cleanup.t | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit d39f8114e44dbc667f8121c1fe1a00d03b8e497c
Author: Brian C. Duggan <brian at bestpractical.com>
Date: Tue Mar 27 19:05:19 2018 -0400
Use GNUPGHOME for gpgconf instead of --homedir
GnuPG >= 2.1.0 starts gpg-agent for the gpg homedir if one is not
already running. gpgconf >= 2.1.0 can kill a gpg-agent for the homedir
with the --kill flag. But gpgconf >= 2.1.0 and <= 2.1.12 do not support
specifying homedir by the '--homedir' flag. That feature was introduced
in 2.1.13.
However, gpgconf >= 2.1.0 and <= 2.1.12 do respect the GNUPGHOME
environment variable. This change skips gpg-agent cleanup in the tests
for GnuPG < 2.1.0. It also updates the gpgconf call to use GNUPGHOME
instead of --homedir in the gpg-agent cleanup.
diff --git a/t/zzz_cleanup.t b/t/zzz_cleanup.t
index 6eba3f4..6029b5d 100644
--- a/t/zzz_cleanup.t
+++ b/t/zzz_cleanup.t
@@ -11,12 +11,15 @@ use File::Path qw (remove_tree);
# this is actually no test, just cleanup.
TEST
{
+ return 1 unless $gnupg->cmp_version($gnupg->version, '2.1') >= 0;
my $homedir = $gnupg->options->homedir();
my $err = [];
- # In classic gpg, gpgconf cannot kill gpg-agent. But these tests
- # will not start an agent when using classic gpg. For modern gpg,
- # kill off any long-lived gpg-agent, ignoring errors:
- system('gpgconf', '--homedir', $homedir, '--quiet', '--kill', 'gpg-agent') if $gnupg->cmp_version($gnupg->version, '2.1') >=0;
+ # kill off any long-lived gpg-agent, ignoring errors.
+ # gpgconf versions < 2.1.11 do not support '--homedir', but still
+ # respect the GNUPGHOME environment variable
+ $ENV{'GNUPGHOME'} = $homedir;
+ system('gpgconf', '--quiet', '--kill', 'gpg-agent');
+ delete $ENV{'GNUPGHOME'};
remove_tree($homedir, {error => \$err});
unlink('test/gnupghome');
return ! @$err;
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list