forked from pool/x3270
37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
|
commit d2f9fa8d7f59c357449ab2b69141700cb5527135
|
||
|
Author: Bernhard M. Wiedemann <bwiedemann@suse.de>
|
||
|
Date: Sun Jun 18 19:49:43 2017 +0200
|
||
|
|
||
|
allow to override build date
|
||
|
|
||
|
to allow reproducible builds of x3270
|
||
|
|
||
|
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.
|
||
|
|
||
|
diff --git a/Common/mkversion.sh b/Common/mkversion.sh
|
||
|
index f5cd712c..33100743 100755
|
||
|
--- a/Common/mkversion.sh
|
||
|
+++ b/Common/mkversion.sh
|
||
|
@@ -40,15 +40,17 @@ export LANG LC_ALL
|
||
|
set -e
|
||
|
|
||
|
. ${2-./version.txt}
|
||
|
-builddate=`date`
|
||
|
-sccsdate=`date +%Y/%m/%d`
|
||
|
+date="date -u"
|
||
|
+[ -n "$SOURCE_DATE_EPOCH" ] && date="$date -d@$SOURCE_DATE_EPOCH"
|
||
|
+builddate=`$date`
|
||
|
+sccsdate=`$date +%Y/%m/%d`
|
||
|
user=${LOGNAME-$USER}
|
||
|
|
||
|
# Create an all numeric timestamp for rpqnames.
|
||
|
# rpq.c will return this string of numbers in bcd format
|
||
|
# It is OK to change the length (+ or -), but use
|
||
|
# decimal (0-9) digits only. Length must be even number of digits.
|
||
|
-rpq_timestamp=`date +%Y%m%d%H%M%S`
|
||
|
+rpq_timestamp=`$date +%Y%m%d%H%M%S`
|
||
|
|
||
|
app=${1-x3270}
|
||
|
cat <<EOF
|