From fbef3c0a211fdf9c24739087b58a23ab63dfb00e Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 15 Sep 2024 13:55:54 +0200 Subject: [PATCH] Should allow reproducible builds --- tools/mkversion.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/mkversion.sh b/tools/mkversion.sh index ce4bc90cc..f4dd350d6 100755 --- a/tools/mkversion.sh +++ b/tools/mkversion.sh @@ -65,7 +65,15 @@ if [ "$commandGIT" != "" ]; then fi if [ "$gitbranch" != "" ] && [ "$gitversion" != "" ]; then fullgitinfo="${fullgitinfo}/${gitbranch}/${gitversion}" - ctime="$(date '+%Y-%m-%d %H:%M:%S')" + # if FORCED_DATE present and properly formatted: + case "$FORCED_DATE" in + [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" "[0-9][0-9]:[0-9][0-9]:[0-9][0-9]) + ctime="$FORCED_DATE" + ;; + *) + ctime="$(date '+%Y-%m-%d %H:%M:%S')" + ;; + esac else fullgitinfo="${fullgitinfo}/master/release (git)" fi