summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2019-06-05 10:12:25 -0600
committerEduardo Chappa <chappa@washington.edu>2019-06-05 10:12:25 -0600
commit050e2800fb26ed0d418c3f947c99402c72492186 (patch)
treea2c62ae9fd7fe3df3d667a1afd25cc93802fdc78 /pith
parent92e425431b22141ce72a5e5afe549d87d61cd0be (diff)
downloadalpine-050e2800fb26ed0d418c3f947c99402c72492186.tar.xz
* Add revision number to message id. This helps me to figure out when
problems exist, so I can go back to the exact bits that caused the problem.
Diffstat (limited to 'pith')
-rw-r--r--pith/pine.hlp2
-rw-r--r--pith/reply.c11
2 files changed, 9 insertions, 4 deletions
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 94ba2c67..6e96f1a3 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 347 2019-06-04 20:14:13
+Alpine Commit 349 2019-06-05 10:12:18
============= h_news =================
<HTML>
<HEAD>
diff --git a/pith/reply.c b/pith/reply.c
index 4963a5d3..00ef3f6f 100644
--- a/pith/reply.c
+++ b/pith/reply.c
@@ -3346,10 +3346,11 @@ char *
generate_message_id(void)
{
static short osec = 0, cnt = 0;
- char idbuf[128];
+ char idbuf[128], revisionbuf[128];
char *id;
time_t now;
struct tm *now_x;
+ char *revision = NULL;
char *hostpart = NULL;
char *alpine_name = NULL;
char *alpine_version = NULL;
@@ -3365,23 +3366,26 @@ generate_message_id(void)
osec = now_x->tm_sec;
}
+ get_alpine_revision_number(revisionbuf, sizeof(revisionbuf));
if(F_ON(F_ROT13_MESSAGE_ID, ps_global)){
hostpart = rot13(ps_global->hostname);
alpine_name = rot13("alpine");
alpine_version = rot5n(ALPINE_VERSION);
system_os = rot13(SYSTYPE);
+ revision = rot5n(revisionbuf);
} else {
hostpart = cpystr(ps_global->hostname);
alpine_name = cpystr("alpine");
alpine_version = cpystr(ALPINE_VERSION);
system_os = cpystr(SYSTYPE);
+ revision = cpystr(revisionbuf);
}
if(!hostpart)
hostpart = cpystr("huh");
- snprintf(idbuf, sizeof(idbuf), "<%.6s.%.4s.%.20s.%02d%02d%02d%02d%02d%02d%X.%d@%.50s>",
- alpine_name, system_os, alpine_version, (now_x->tm_year) % 100, now_x->tm_mon + 1,
+ snprintf(idbuf, sizeof(idbuf), "<%.6s.%.4s.%.20s.%.10s.%02d%02d%02d%02d%02d%02d%X.%d@%.50s>",
+ alpine_name, system_os, alpine_version, revision,(now_x->tm_year) % 100, now_x->tm_mon + 1,
now_x->tm_mday, now_x->tm_hour, now_x->tm_min, now_x->tm_sec,
cnt, getpid(), hostpart);
idbuf[sizeof(idbuf)-1] = '\0';
@@ -3392,6 +3396,7 @@ generate_message_id(void)
if(alpine_name) fs_give((void **) & alpine_name);
if(alpine_version) fs_give((void **)&alpine_version);
if(system_os) fs_give((void **)&system_os);
+ if(revision) fs_give((void **)&revision);
return(id);
}