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

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=29c0ac07546e9affbe770bca593dd62573d99a7c

commit 29c0ac07546e9affbe770bca593dd62573d99a7c
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Dec 23 02:38:05 2023 +0100

    Dpkg::OpenPGP::Backend::GnuPG: Look harder for trustedkeys keyring
    
    Check under $GNUPGHOME, and for the .kbx and .gpg variants.
---
 scripts/Dpkg/OpenPGP/Backend/GnuPG.pm | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/scripts/Dpkg/OpenPGP/Backend/GnuPG.pm 
b/scripts/Dpkg/OpenPGP/Backend/GnuPG.pm
index 942b88acf..9c53ef122 100644
--- a/scripts/Dpkg/OpenPGP/Backend/GnuPG.pm
+++ b/scripts/Dpkg/OpenPGP/Backend/GnuPG.pm
@@ -88,9 +88,18 @@ sub has_verify_cmd {
 sub get_trusted_keyrings {
     my $self = shift;
 
+    my $keystore;
+    if ($ENV{GNUPGHOME} && -e $ENV{GNUPGHOME}) {
+        $keystore = $ENV{GNUPGHOME};
+    } elsif ($ENV{HOME} && -e "$ENV{HOME}/.gnupg") {
+        $keystore = "$ENV{HOME}/.gnupg";
+    } else {
+        return;
+    }
+
     my @keyrings;
-    if (length $ENV{HOME} and -r "$ENV{HOME}/.gnupg/trustedkeys.gpg") {
-        push @keyrings, "$ENV{HOME}/.gnupg/trustedkeys.gpg";
+    foreach my $keyring (qw(trustedkeys.kbx trustedkeys.gpg)) {
+        push @keyrings, "$keystore/$keyring" if -r "$keystore/$keyring";
     }
     return @keyrings;
 }

-- 
Dpkg.Org's dpkg

Reply via email to