Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
* [Drbd-dev] [PATCH] drbd: Allow to override build date
@ 2017-07-18  8:35 Bernhard M. Wiedemann
  2017-07-18  9:13 ` [Drbd-dev] [PATCH] drbd: Allow to override build date (v2) Bernhard M. Wiedemann
  0 siblings, 1 reply; 9+ messages in thread
From: Bernhard M. Wiedemann @ 2017-07-18  8:35 UTC (permalink / raw)
  To: drbd-dev

and to not record build user, hostname if requested
in order to allow for reproducible builds.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
---
 drbd/Kbuild | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drbd/Kbuild b/drbd/Kbuild
index 2d1b4d0..f355496 100644
--- a/drbd/Kbuild
+++ b/drbd/Kbuild
@@ -134,5 +134,10 @@ $(obj)/drbd_buildtag.c: $(filter-out drbd_buildtag.o,$(drbd-y))
 		echo >&2 "Your DRBD source tree is broken. Unpack again.";      \
 		exit 1;								\
 	fi ;									\
-	echo -e "\t\t\" build by $$USER@$$HOSTNAME, `date "+%F %T"`\";\n}";	\
+	if [ -z "${SOURCE_DATE_EPOCH}" ] ; then \
+		buildinfo="build by $$USER@$$HOSTNAME, `date "+%F %T"`" ; \
+	else \
+		buildinfo="reproducible build, `date -u -d@${SOURCE_DATE_EPOCH} "+%F %T"`" ; \
+	fi ; \
+	echo -e "\t\t\" $buildinfo\";\n}";	\
 	mv -f $@.new $@
-- 
2.12.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-07-24  5:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18  8:35 [Drbd-dev] [PATCH] drbd: Allow to override build date Bernhard M. Wiedemann
2017-07-18  9:13 ` [Drbd-dev] [PATCH] drbd: Allow to override build date (v2) Bernhard M. Wiedemann
2017-07-18 12:35   ` Roland Kammerer
2017-07-18 12:47     ` Bernhard M. Wiedemann
2017-07-18 12:48       ` [Drbd-dev] [PATCH] drbd: Allow to override build date (v3) Bernhard M. Wiedemann
2017-07-23 15:57         ` [Drbd-dev] [PATCH] drbd-utils: Allow to override build date Bernhard M. Wiedemann
2017-07-24  5:16           ` Roland Kammerer
2017-07-18 14:45       ` [Drbd-dev] [PATCH] drbd: Allow to override build date (v2) Roland Kammerer
2017-07-18 14:59         ` Bernhard M. Wiedemann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox