• Bug#1104800: gpgparticipants-filter: Make filter argument optional

    From =?utf-8?q?Uwe_Kleine-K=C3=B6nig?=@21:1/5 to All on Tue May 6 19:30:01 2025
    Package: signing-party
    Version: 2.12-1
    Severity: minor
    Tags: patch
    X-Debbugs-Cc: ukleinek@debian.org

    Hello,

    when using a dedicated GNUPG_HOMEDIR for the keys of a party's
    participants, it's convenient if gpgparticipants-filter emits all keys
    when no filter is provided.

    The following patch implements this feature:

    From e3d7d888e71643e0c77c6073cca707a4d9c230c0 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <ukleinek@debian.org>
    Date: Tue, 6 May 2025 19:02:19 +0200
    Subject: [PATCH] gpgparticipants-filter: Make filter argument optional

    Without arguments default to list all keys which matches the behavior
    of `gpg --list-keys`.
    ---
    gpgparticipants/gpgparticipants-filter | 22 ++++++++++------------
    gpgparticipants/gpgparticipants-filter.1 | 2 +-
    2 files changed, 11 insertions(+), 13 deletions(-)

    diff --git a/gpgparticipants/gpgparticipants-filter b/gpgparticipants/gpgparticipants-filter
    index 8899a28e2635..5e016dd31b85 100755
    --- a/gpgparticipants/gpgparticipants-filter
    +++ b/gpgparticipants/gpgparticipants-filter
    @@ -79,7 +79,7 @@ class KeyDataSet:
    return self.valid_flag not in ['e', 'r']


    -def filter_to_gpg(filter_string, gpg_bin, set_homedir, homedir):
    +def filter_to_gpg(filter_strings, gpg_bin, set_homedir, homedir):
    """
    Call gpg and return output.
    """
    @@ -94,7 +94,7 @@ def filter_to_gpg(filter_string, gpg_bin, set_homedir, homedir):
    command.append("--homedir")
    command.append(homedir)

    - command.append(filter_string)
    + command.extend(filter_strings)

    with subprocess.Popen(command, stdout=subprocess.PIPE) as process:
    return process.stdo