[Pkg-gnupg-commit] [gnupg2] 97/241: gpg: Also show when the most recently signed message was observed.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Wed Dec 9 20:32:00 UTC 2015
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gnupg2.
commit 621afac37e5555fd68054531e611ead444b62928
Author: Neal H. Walfield <neal at g10code.com>
Date: Tue Nov 3 16:26:25 2015 +0100
gpg: Also show when the most recently signed message was observed.
* g10/tofu.c (show_statistics): Also show when the most recently
signed message was observed.
--
Signed-off-by: Neal H. Walfield <neal at g10code.com>.
Suggested-by: MFPA <2014-667rhzu3dc-lists-groups at riseup.net>
---
g10/tofu.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/g10/tofu.c b/g10/tofu.c
index 06183ed..4dcaa11 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -2377,6 +2377,7 @@ show_statistics (struct dbs *dbs, const char *fingerprint,
char *tail = NULL;
signed long messages;
signed long first_seen_ago;
+ signed long most_recent_seen_ago;
assert (strlist_length (strlist) == 3);
@@ -2392,7 +2393,10 @@ show_statistics (struct dbs *dbs, const char *fingerprint,
if (messages == 0 && *strlist->next->d == '\0')
/* min(NULL) => NULL => "". */
- first_seen_ago = -1;
+ {
+ first_seen_ago = -1;
+ most_recent_seen_ago = -1;
+ }
else
{
errno = 0;
@@ -2405,6 +2409,17 @@ show_statistics (struct dbs *dbs, const char *fingerprint,
strlist->next->d, strerror (errno));
first_seen_ago = 0;
}
+
+ errno = 0;
+ most_recent_seen_ago = strtol (strlist->next->next->d, &tail, 0);
+ if (errno || *tail != '\0')
+ /* Abort. */
+ {
+ log_debug ("%s:%d: Couldn't convert %s (most_recent_seen) to an int: %s.\n",
+ __func__, __LINE__,
+ strlist->next->next->d, strerror (errno));
+ most_recent_seen_ago = 0;
+ }
}
if (messages == -1 || first_seen_ago == 0)
@@ -2428,6 +2443,8 @@ show_statistics (struct dbs *dbs, const char *fingerprint,
else
{
char *first_seen_ago_str = time_ago_str (first_seen_ago);
+ char *most_recent_seen_ago_str =
+ time_ago_str (most_recent_seen_ago);
es_fprintf (fp,
_("Verified %ld messages signed by \"%s\""
@@ -2436,8 +2453,13 @@ show_statistics (struct dbs *dbs, const char *fingerprint,
fingerprint_pp, tofu_policy_str (policy),
first_seen_ago_str);
+ if (messages > 1)
+ es_fprintf (fp,
+ _(" The most recent message was verified %s ago."),
+ most_recent_seen_ago_str);
xfree (first_seen_ago_str);
+ xfree (most_recent_seen_ago_str);
}
es_fputc (0, fp);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list