From b18b9b972e2da2fd30c4bfd64c2c6b09213bd1cf Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 7 Oct 2022 15:01:02 +0200 Subject: [PATCH] wkd: Silence gpg-wks-client diagnostics from gpg. * tools/gpg-wks-client.c (add_user_id): PAss --quiet to gpg unless we are running in double verbose mode. (decrypt_stream): Ditto (encrypt_response): Ditto. (mirror_one_keys_userid): Ditto. * tools/wks-util.c (wks_get_key): Ditto. (wks_list_key): Ditto. (wks_filter_uid): Ditto. (cherry picked from commit 4364283f757fceab454d48d461a9f88c31247a07) --- tools/gpg-wks-client.c | 14 +++++++------- tools/wks-util.c | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/gpg-wks-client.c b/tools/gpg-wks-client.c index 5a8203087..05680eb9d 100644 --- a/tools/gpg-wks-client.c +++ b/tools/gpg-wks-client.c @@ -532,9 +532,9 @@ add_user_id (const char *fingerprint, const char *uid) ccparray_init (&ccp, 0); ccparray_put (&ccp, "--no-options"); - if (!opt.verbose) + if (opt.verbose < 2) ccparray_put (&ccp, "--quiet"); - else if (opt.verbose > 1) + else ccparray_put (&ccp, "--verbose"); ccparray_put (&ccp, "--batch"); ccparray_put (&ccp, "--always-trust"); @@ -621,9 +621,9 @@ decrypt_stream (estream_t *r_output, struct decrypt_stream_parm_s *decinfo, * tricks. A regular client will anyway only send a minimal key; * that is one w/o key signatures and attribute packets. */ ccparray_put (&ccp, "--max-output=0x10000"); - if (!opt.verbose) + if (opt.verbose < 2) ccparray_put (&ccp, "--quiet"); - else if (opt.verbose > 1) + else ccparray_put (&ccp, "--verbose"); ccparray_put (&ccp, "--batch"); ccparray_put (&ccp, "--status-fd=2"); @@ -1269,9 +1269,9 @@ encrypt_response (estream_t *r_output, estream_t input, const char *addrspec, ccparray_init (&ccp, 0); ccparray_put (&ccp, "--no-options"); - if (!opt.verbose) + if (opt.verbose < 2) ccparray_put (&ccp, "--quiet"); - else if (opt.verbose > 1) + else ccparray_put (&ccp, "--verbose"); ccparray_put (&ccp, "--batch"); ccparray_put (&ccp, "--status-fd=2"); @@ -1692,7 +1692,7 @@ mirror_one_keys_userid (estream_t key, const char *mbox, uidinfo_list_t uidlist, } err = wks_install_key_core (newkey? newkey : key, mbox); - if (!opt.quiet) + if (opt.verbose) log_info ("key %s published for '%s'\n", fpr, mbox); mirror_one_key_parm.nuids++; if (!opt.quiet && !(mirror_one_key_parm.nuids % 25)) diff --git a/tools/wks-util.c b/tools/wks-util.c index cdbaeecfc..3044fe2f8 100644 --- a/tools/wks-util.c +++ b/tools/wks-util.c @@ -216,9 +216,9 @@ wks_get_key (estream_t *r_key, const char *fingerprint, const char *addrspec, ccparray_init (&ccp, 0); ccparray_put (&ccp, "--no-options"); - if (!opt.verbose) + if (opt.verbose < 2) ccparray_put (&ccp, "--quiet"); - else if (opt.verbose > 1) + else ccparray_put (&ccp, "--verbose"); ccparray_put (&ccp, "--batch"); ccparray_put (&ccp, "--status-fd=2"); @@ -313,9 +313,9 @@ wks_list_key (estream_t key, char **r_fpr, uidinfo_list_t *r_mboxes) ccparray_init (&ccp, 0); ccparray_put (&ccp, "--no-options"); - if (!opt.verbose) + if (opt.verbose < 2) ccparray_put (&ccp, "--quiet"); - else if (opt.verbose > 1) + else ccparray_put (&ccp, "--verbose"); ccparray_put (&ccp, "--batch"); ccparray_put (&ccp, "--status-fd=2"); @@ -489,9 +489,9 @@ wks_filter_uid (estream_t *r_newkey, estream_t key, const char *uid, ccparray_init (&ccp, 0); ccparray_put (&ccp, "--no-options"); - if (!opt.verbose) + if (opt.verbose < 2) ccparray_put (&ccp, "--quiet"); - else if (opt.verbose > 1) + else ccparray_put (&ccp, "--verbose"); ccparray_put (&ccp, "--batch"); ccparray_put (&ccp, "--status-fd=2");