From 2283585e391a6ca40a4abc252ac0e2111942b2d1 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Fri, 12 Jan 2018 13:41:09 +0000 Subject: [PATCH] Remove build timestamp information for reproducible builds. --- CMakeLists.txt | 10 +--------- ChangeLog.txt | 2 ++ config.mk | 3 +-- man/mosquitto.8.xml | 12 ------------ src/conf.c | 2 +- src/mosquitto.c | 2 +- src/sys_tree.c | 2 -- 7 files changed, 6 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc40bad6..f6837764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,15 +13,7 @@ cmake_minimum_required(VERSION 2.8) set (VERSION 1.4.90) -if (WIN32) - execute_process(COMMAND cmd /c echo %DATE% %TIME% OUTPUT_VARIABLE TIMESTAMP - OUTPUT_STRIP_TRAILING_WHITESPACE) -else (WIN32) - execute_process(COMMAND date "+%F %T%z" OUTPUT_VARIABLE TIMESTAMP - OUTPUT_STRIP_TRAILING_WHITESPACE) -endif (WIN32) - -add_definitions (-DCMAKE -DVERSION=\"${VERSION}\" -DTIMESTAMP=\"${TIMESTAMP}\") +add_definitions (-DCMAKE -DVERSION=\"${VERSION}\") if (WIN32) set (BINDIR .) diff --git a/ChangeLog.txt b/ChangeLog.txt index 00fe53b2..6aefbfc7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -42,6 +42,8 @@ Broker: - When using the include_dir configuration option sort the files alphabetically before loading them. Closes #17. - IPv6 is no longer disabled for websockets listeners. +- Remove all build timestamp information including $SYS/broker/timestamp. + Close #651. Client library: - Outgoing messages with QoS>1 are no longer retried after a timeout period. diff --git a/config.mk b/config.mk index bd6c7b25..01850274 100644 --- a/config.mk +++ b/config.mk @@ -108,7 +108,6 @@ SOVERSION=1 XSLTPROC=xsltproc # For html generation DB_HTML_XSL=man/html.xsl -TIMESTAMP:=$(shell date "+%F %T%z") #MANCOUNTRIES=en_GB @@ -128,7 +127,7 @@ LIB_CFLAGS:=${CFLAGS} ${CPPFLAGS} -I. -I.. -I../lib LIB_CXXFLAGS:=$(LIB_CFLAGS) ${CPPFLAGS} LIB_LDFLAGS:=${LDFLAGS} -BROKER_CFLAGS:=${LIB_CFLAGS} ${CPPFLAGS} -DVERSION="\"${VERSION}\"" -DTIMESTAMP="\"${TIMESTAMP}\"" -DWITH_BROKER +BROKER_CFLAGS:=${LIB_CFLAGS} ${CPPFLAGS} -DVERSION="\"${VERSION}\"" -DWITH_BROKER CLIENT_CFLAGS:=${CFLAGS} ${CPPFLAGS} -I../lib -DVERSION="\"${VERSION}\"" ifneq ($(or $(findstring $(UNAME),FreeBSD), $(findstring $(UNAME),OpenBSD)),) diff --git a/man/mosquitto.8.xml b/man/mosquitto.8.xml index 28ac0220..f771f1a1 100644 --- a/man/mosquitto.8.xml +++ b/man/mosquitto.8.xml @@ -343,18 +343,6 @@ The total number of subscriptions active on the broker. - - - - The timestamp at which this particular build of the broker was made. Static. - - - - - - The amount of time in seconds the broker has been online. - - diff --git a/src/conf.c b/src/conf.c index 7d8caa49..fb37c475 100644 --- a/src/conf.c +++ b/src/conf.c @@ -331,7 +331,7 @@ void config__cleanup(struct mosquitto__config *config) static void print_usage(void) { - printf("mosquitto version %s (build date %s)\n\n", VERSION, TIMESTAMP); + printf("mosquitto version %s\n\n", VERSION); printf("mosquitto is an MQTT v3.1.1 broker.\n\n"); printf("Usage: mosquitto [-c config_file] [-d] [-h] [-p port]\n\n"); printf(" -c : specify the broker config file.\n"); diff --git a/src/mosquitto.c b/src/mosquitto.c index c160e75c..6bb74404 100644 --- a/src/mosquitto.c +++ b/src/mosquitto.c @@ -268,7 +268,7 @@ int main(int argc, char *argv[]) rc = 1; return rc; } - log__printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s (build date %s) starting", VERSION, TIMESTAMP); + log__printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s starting", VERSION); if(config.config_file){ log__printf(NULL, MOSQ_LOG_INFO, "Config loaded from %s.", config.config_file); }else{ diff --git a/src/sys_tree.c b/src/sys_tree.c index 7f523297..a4cfca09 100644 --- a/src/sys_tree.c +++ b/src/sys_tree.c @@ -53,8 +53,6 @@ void sys_tree__init(struct mosquitto_db *db) /* Set static $SYS messages */ snprintf(buf, 64, "mosquitto version %s", VERSION); db__messages_easy_queue(db, NULL, "$SYS/broker/version", SYS_TREE_QOS, strlen(buf), buf, 1); - snprintf(buf, 64, "%s", TIMESTAMP); - db__messages_easy_queue(db, NULL, "$SYS/broker/timestamp", SYS_TREE_QOS, strlen(buf), buf, 1); } static void sys_tree__update_clients(struct mosquitto_db *db, char *buf)