svn commit: r306740 - head/gnu/usr.bin/groff

Ed Maste emaste at FreeBSD.org
Wed Oct 5 23:25:30 UTC 2016


Author: emaste
Date: Wed Oct  5 23:25:29 2016
New Revision: 306740
URL: https://svnweb.freebsd.org/changeset/base/306740

Log:
  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.
  
  Reviewed by:	bapt
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D8158

Added:
  head/gnu/usr.bin/groff/mdate.sh   (contents, props changed)
Modified:
  head/gnu/usr.bin/groff/Makefile.inc

Modified: head/gnu/usr.bin/groff/Makefile.inc
==============================================================================
--- head/gnu/usr.bin/groff/Makefile.inc	Wed Oct  5 22:26:48 2016	(r306739)
+++ head/gnu/usr.bin/groff/Makefile.inc	Wed Oct  5 23:25:29 2016	(r306740)
@@ -119,7 +119,7 @@ revision=`sed -e 's/^0$$//' -e 's/^[1-9]
 	-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}

Added: head/gnu/usr.bin/groff/mdate.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/gnu/usr.bin/groff/mdate.sh	Wed Oct  5 23:25:29 2016	(r306740)
@@ -0,0 +1,9 @@
+#!/bin/sh
+# $FreeBSD$
+
+set -e
+test -r "$1"
+export LC_ALL=C
+changelog_date=$(sed -E -n 's/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1" |\
+    head -n 1)
+echo $(date -j -f %Y-%m-%d +"%e %B %Y" $changelog_date)


More information about the svn-src-all mailing list