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=a0829640d9cc6b1ac020bd1e2a913ba7deb51696 commit a0829640d9cc6b1ac020bd1e2a913ba7deb51696 Author: Guillem Jover <[email protected]> AuthorDate: Thu Feb 6 10:44:31 2025 +0100 Dpkg::OpenPGP::Backend: Generalize has_verify_cmd() We can extend the implementation to automatically support backends that have support for cmdv and ones that do not based on whether they have a DEFAULT_CMDV list. This makes it possible to remove the GnuPG backend specific implementation. --- scripts/Dpkg/OpenPGP/Backend.pm | 4 +++- scripts/Dpkg/OpenPGP/Backend/GnuPG.pm | 6 ------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/Dpkg/OpenPGP/Backend.pm b/scripts/Dpkg/OpenPGP/Backend.pm index a3ffad39a..0216941e7 100644 --- a/scripts/Dpkg/OpenPGP/Backend.pm +++ b/scripts/Dpkg/OpenPGP/Backend.pm @@ -87,7 +87,9 @@ sub has_backend_cmd { sub has_verify_cmd { my $self = shift; - return defined $self->{cmd}; + return 1 if @{$self->DEFAULT_CMDV()} && defined $self->{cmdv}; + return 1 if defined $self->{cmd}; + return 0; } sub has_keystore { diff --git a/scripts/Dpkg/OpenPGP/Backend/GnuPG.pm b/scripts/Dpkg/OpenPGP/Backend/GnuPG.pm index 7f9b48a8b..c930cb351 100644 --- a/scripts/Dpkg/OpenPGP/Backend/GnuPG.pm +++ b/scripts/Dpkg/OpenPGP/Backend/GnuPG.pm @@ -74,12 +74,6 @@ sub can_use_key { return $self->has_keystore(); } -sub has_verify_cmd { - my $self = shift; - - return defined $self->{cmdv} || defined $self->{cmd}; -} - sub get_trusted_keyrings { my $self = shift; -- Dpkg.Org's dpkg

