From 6040d8f43eac4021f3cb376efc32697f66fb64f3 Mon Sep 17 00:00:00 2001 From: Viktor Kleinik Date: Mon, 11 Jan 2021 06:29:00 -0800 Subject: [PATCH] Use BUILD_DATE for reproducibility Use reproducible build date instead of compilation time and date. Signed-off-by: Viktor Kleinik --- src/rrd_cgi.c | 4 ++++ src/rrd_tool.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index 8576a9bf..e58069f6 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -680,7 +680,11 @@ static char *rrdgetinternal( if (strcasecmp(args[0], "VERSION") == 0) { return stralloc(PACKAGE_VERSION); } else if (strcasecmp(args[0], "COMPILETIME") == 0) { +#ifdef BUILD_DATE + return stralloc(BUILD_DATE); +#else return stralloc(__DATE__ " " __TIME__); +#endif } else { return stralloc("[ERROR: internal unknown argument]"); } diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 679e1745..16645cf3 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -309,7 +309,11 @@ static void PrintUsage( else if (!strcmp(cmd, "pwd")) help_cmd = C_PWD; } +#ifdef BUILD_DATE + fprintf(stdout, _(help_main), PACKAGE_VERSION, BUILD_DATE); +#else fprintf(stdout, _(help_main), PACKAGE_VERSION, __DATE__, __TIME__); +#endif fflush(stdout); switch (help_cmd) { case C_NONE: -- 2.47.2