From be116e6ea6ecd02d0cfaa79c529d4e6b7c31a353 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Wed, 16 Dec 2015 23:25:45 +0100 Subject: Embed deterministic timestamp in manpages If the build system supports SOURCE_DATE_EPOCH [1], use this timestamp for the manpages, instead of using the current date. This will generate reproducible manpages. Fall back to old behavior if variable is not set. Also normalize locale and timezone. [1]: https://reproducible-builds.org/specs/source-date-epoch/ --- mkman.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mkman.sh') diff --git a/mkman.sh b/mkman.sh index f2a5ef3c6..5cc79d277 100755 --- a/mkman.sh +++ b/mkman.sh @@ -1,7 +1,7 @@ #!/bin/bash sed "s/VERSION/$1/g" $2 > $3 -MONTH=`date +%b` +MONTH=`LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%b` sed -i "s/MONTH/$MONTH/g" $3 -YEAR=`date +%Y` +YEAR=`LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y` sed -i "s/YEAR/$YEAR/g" $3 -- cgit v1.2.3-54-g00ecf