From 4b7f4f04e39779c3496855ea46fff565c360a4d5 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 2 Nov 2026 02:14:11 +0100 Subject: Prepare a versioning mechanism for the tracker that works from tarballs --- ot_stats.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ot_stats.c') diff --git a/ot_stats.c b/ot_stats.c index eb046a0..a9f12cc 100644 --- a/ot_stats.c +++ b/ot_stats.c @@ -547,9 +547,12 @@ static void stats_return_everything(char **reply, const char *reply_end) { } void stats_return_tracker_version(char **reply, const char *reply_end) { -#define QUOTE(name) #name -#define SQUOTE(name) QUOTE(name) - fmt_append(reply, reply_end, "https://erdgeist.org/gitweb/opentracker/commit/?id=" SQUOTE(GIT_VERSION) "\n"); + fmt_append(reply, reply_end, "opentracker %s", OT_VERSION); + /* Empty when the build had no git to ask, which is what a release tarball + looks like */ + if (*GIT_VERSION) + fmt_append(reply, reply_end, " (%s)", GIT_VERSION); + fmt_append(reply, reply_end, "\n"); } void return_stats_for_tracker(char **reply, const char *reply_end, int mode, int format) { -- cgit v1.3