diff options
Diffstat (limited to 'contrib/ntp/scripts/build/mkver.in')
-rw-r--r-- | contrib/ntp/scripts/build/mkver.in | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/ntp/scripts/build/mkver.in b/contrib/ntp/scripts/build/mkver.in index 3aef1c816a7f..c58d8040f1d9 100644 --- a/contrib/ntp/scripts/build/mkver.in +++ b/contrib/ntp/scripts/build/mkver.in @@ -15,7 +15,12 @@ case "@VER_SUFFIX@" in *) ConfStr="${ConfStr}-@VER_SUFFIX@" ;; esac -ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`" +if [ -n "$SOURCE_DATE_EPOCH" ]; then + ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -d@$SOURCE_DATE_EPOCH 2>/dev/null`" || + ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -r $SOURCE_DATE_EPOCH`" +else + ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`" +fi if [ ! -f .version ]; then echo 0 > .version |