summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2016-10-19 13:19:45 +0000
committeremaste <emaste@FreeBSD.org>2016-10-19 13:19:45 +0000
commit9837f2846a73d054cd7637ec275baa49506a0216 (patch)
tree01323eda84ab1eba345531302e51d34d9a339f9f
parentac79a49cf3eb50dbb15aaf3bfa3da42ba0b847b2 (diff)
downloadFreeBSD-src-9837f2846a73d054cd7637ec275baa49506a0216.zip
FreeBSD-src-9837f2846a73d054cd7637ec275baa49506a0216.tar.gz
MFC r306740, r307150: groff: use changelog date in man pages
r306740: groff: use changelog date rather than file modification date in man pages The source checkout date is not particularly relevant, and this makes groff man pages build reproducibly. r307150: Avoid using 'head' in generating groff doc date It may not be available in certain cross build cases. Note that this is a slight change in functionality, in that now only the first line of the source ChangeLog file is processed. This is acceptable as groff will be retired and we won't encounter a possibly-different ChangeLog format.
-rw-r--r--gnu/usr.bin/groff/Makefile.inc3
-rwxr-xr-xgnu/usr.bin/groff/mdate.sh8
2 files changed, 10 insertions, 1 deletions
diff --git a/gnu/usr.bin/groff/Makefile.inc b/gnu/usr.bin/groff/Makefile.inc
index 24bcd98..eced62d 100644
--- a/gnu/usr.bin/groff/Makefile.inc
+++ b/gnu/usr.bin/groff/Makefile.inc
@@ -119,7 +119,7 @@ revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(GROFF_DIST)/REVISION`
-e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \
-e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \
-e "s;@VERSION@;$(version)$(revision);g" \
- -e "s;@MDATE@;`$(SHELL) ${GROFF_DIST}/mdate.sh $<`;g" \
+ -e "s;@MDATE@;$(MDATE);g" \
-e "s;@g@;$(g);g" \
-e "s;@G@;`echo $(g) | LC_ALL=C tr a-z A-Z`;g" \
$< >$@
@@ -141,4 +141,5 @@ TOPREL?= ..
GROFF_DIST= ${.CURDIR}/${TOPREL}/../../../contrib/groff
DIST_SUBDIR?= ${.CURDIR:T}
DIST_DIR= ${GROFF_DIST}/${DIST_SUBDIR}
+MDATE!= sh ${.CURDIR}/${TOPREL}/mdate.sh ${GROFF_DIST}/ChangeLog
.PATH: ${DIST_DIR}
diff --git a/gnu/usr.bin/groff/mdate.sh b/gnu/usr.bin/groff/mdate.sh
new file mode 100755
index 0000000..03a4a09
--- /dev/null
+++ b/gnu/usr.bin/groff/mdate.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# $FreeBSD$
+
+set -e
+test -r "$1"
+export LC_ALL=C
+changelog_date=$(sed -E -n '1s/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1")
+echo $(date -j -f %Y-%m-%d +"%e %B %Y" $changelog_date)
OpenPOWER on IntegriCloud