1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-05-24 16:43:28 +02:00

trustdb: Respect --quiet during --import-ownertrust.

* g10/tdbdump.c (import_ownertrust): If opt.quiet is set, do not send
log_info messages.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
Daniel Kahn Gillmor 2017-02-25 18:02:27 -05:00
parent 64ec21bebd
commit ddf01a67d6

View File

@ -192,18 +192,22 @@ import_ownertrust( const char *fname )
rc = tdbio_search_trust_byfpr (fpr, &rec); rc = tdbio_search_trust_byfpr (fpr, &rec);
if( !rc ) { /* found: update */ if( !rc ) { /* found: update */
if (rec.r.trust.ownertrust != otrust) if (rec.r.trust.ownertrust != otrust)
{
if (!opt.quiet)
{ {
if( rec.r.trust.ownertrust ) if( rec.r.trust.ownertrust )
log_info("changing ownertrust from %u to %u\n", log_info("changing ownertrust from %u to %u\n",
rec.r.trust.ownertrust, otrust ); rec.r.trust.ownertrust, otrust );
else else
log_info("setting ownertrust to %u\n", otrust ); log_info("setting ownertrust to %u\n", otrust );
}
rec.r.trust.ownertrust = otrust; rec.r.trust.ownertrust = otrust;
write_record (&rec ); write_record (&rec );
any = 1; any = 1;
} }
} }
else if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND) { /* insert */ else if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND) { /* insert */
if (!opt.quiet)
log_info("inserting ownertrust of %u\n", otrust ); log_info("inserting ownertrust of %u\n", otrust );
memset (&rec, 0, sizeof rec); memset (&rec, 0, sizeof rec);
rec.recnum = tdbio_new_recnum (); rec.recnum = tdbio_new_recnum ();