Skip to content

Commit

Permalink
Remove build timestamp information for reproducible builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Jan 12, 2018
1 parent 2cd553c commit 2283585
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 27 deletions.
10 changes: 1 addition & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 .)
Expand Down
2 changes: 2 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)),)
Expand Down
12 changes: 0 additions & 12 deletions man/mosquitto.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,6 @@
<para>The total number of subscriptions active on the broker.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>$SYS/broker/timestamp</option></term>
<listitem>
<para>The timestamp at which this particular build of the broker was made. Static.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>$SYS/broker/uptime</option></term>
<listitem>
<para>The amount of time in seconds the broker has been online.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>$SYS/broker/version</option></term>
<listitem>
Expand Down
2 changes: 1 addition & 1 deletion src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/mosquitto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 0 additions & 2 deletions src/sys_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2283585

Please sign in to comment.