Skip to content

Commit

Permalink
Use SOURCE_DATE_EPOCH to build man pages.
Browse files Browse the repository at this point in the history
Expand c02f755 to use the
SOURCE_DATE_EPOCH environment variable to create the timestamps
in the .nro man page files.
Also change mkhelp.py to use SOURCE_DATE_EPOCH like mkhelp.pl.

Related to #583.
  • Loading branch information
gwsw committed Oct 26, 2024
1 parent 9c7105e commit 98d5fd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile.aut
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ distclean: clean
realclean: clean

REPLACE_VERSION = \
DT=`date '+%d %h %Y'`; \
if [ -n "${SOURCE_DATE_EPOCH}" ]; then DFLAG="-d@${SOURCE_DATE_EPOCH}"; fi; \
DT=`date $$DFLAG '+%d %h %Y'`; \
echo "Stuffing version number ${REL} into $@"; \
rm -f $@; \
sed \
Expand Down
4 changes: 3 additions & 1 deletion mkhelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import time
import sys
import os

time = time.gmtime()
epoch = os.environ.get("SOURCE_DATE_EPOCH")
time = time.gmtime(None if epoch == None else int(epoch))
print("/* This file was generated by mkhelp.py from less.hlp at "\
"%d:%02d GMT on %d/%d/%d */\n" %
(time.tm_hour, time.tm_min, time.tm_year, time.tm_mon, time.tm_mday))
Expand Down

0 comments on commit 98d5fd4

Please sign in to comment.