[Pkg-privacy-commits] [parcimonie] 02/10: Honor custom GnuPG homedir in a few places that did not so far.

Intrigeri intrigeri at moszumanska.debian.org
Tue Jun 27 17:12:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch master
in repository parcimonie.

commit 561538c8b9012c23534e3c394de676061d51042d
Author: intrigeri <intrigeri at boum.org>
Date:   Sun Sep 11 11:23:30 2016 +0000

    Honor custom GnuPG homedir in a few places that did not so far.
    
    This resulted for example in the test suite trying to start a dirmngr
    using ~/.gnupg/, while we had instructed it to use a custom GnuPG
    homedir; as a result, tests were failing for wrong reasons.
---
 lib/App/Parcimonie.pm                 |  8 +++++++-
 lib/App/Parcimonie/GnuPG/Interface.pm | 10 ++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/lib/App/Parcimonie.pm b/lib/App/Parcimonie.pm
index 71d373f..0bbcbba 100644
--- a/lib/App/Parcimonie.pm
+++ b/lib/App/Parcimonie.pm
@@ -174,7 +174,13 @@ sub checkGpgHasDefinedKeyserver {
     my $gnupg2        = $arg_ref->{gnupg2};
 
     if ($gnupg2) {
-        my @output = capturex(qw{gpg-connect-agent --dirmngr keyserver /bye});
+        my @homedir_args = defined $gnupg_homedir
+            ? ('--homedir', $gnupg_homedir)
+            : ();
+        my @output = capturex(
+            'gpg-connect-agent', @homedir_args,
+            qw{--dirmngr keyserver /bye}
+        );
         my $res = pop @output;
         $res eq "OK\n" || croak "Agent replied: $res";
         if (@output) {
diff --git a/lib/App/Parcimonie/GnuPG/Interface.pm b/lib/App/Parcimonie/GnuPG/Interface.pm
index 13bb6dc..8c53a6b 100644
--- a/lib/App/Parcimonie/GnuPG/Interface.pm
+++ b/lib/App/Parcimonie/GnuPG/Interface.pm
@@ -38,10 +38,16 @@ after 'BUILD' => sub {
     my $self = shift;
     if ($self->gnupg2) {
         unless ($self->already_torified) {
-            system(q{echo 'use-tor:0:1' | gpgconf --change-options dirmngr});
+            my $gnupg_homedir = defined $self->options->homedir()
+                ? $self->options->homedir()
+                : '';
+            system(
+                q{echo 'use-tor:0:1' | } .
+                "GNUPGHOME='$gnupg_homedir' gpgconf --change-options dirmngr"
+            );
             # Passing --runtime to the previous command does not work,
             # so we have to:
-            systemx(qw{gpgconf --reload dirmngr});
+            system("GNUPGHOME='$gnupg_homedir' gpgconf --reload dirmngr");
         }
         $self->call('gpg2');
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/parcimonie.git



More information about the Pkg-privacy-commits mailing list