Replace revision and publication date in generated documentation with
the actual date of last update. This fixes the problems with misleading "last update" dates that only reflect the change in a single rarely-changed file. Note that hrs had reservations about doing this in the Makefile rather than with a stylesheet. However, not all our source files are XML. For now, this change works, and can be replaced by a more elegant solution later. We should also consider checking dates on other files that affect the content or appearance of documents, like images. Submitted by: grembo
This commit is contained in:
parent
88d401f729
commit
094ccc9b32
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=48778
4 changed files with 17 additions and 4 deletions
|
@ -32,6 +32,7 @@ SED?= /usr/bin/sed
|
|||
SETENV?= /usr/bin/env
|
||||
SH?= /bin/sh
|
||||
SORT?= /usr/bin/sort
|
||||
TAIL?= /usr/bin/tail
|
||||
TOUCH?= /usr/bin/touch
|
||||
TRUE?= /usr/bin/true
|
||||
XARGS?= /usr/bin/xargs
|
||||
|
|
|
@ -84,6 +84,18 @@ CSS_SHEET?= ${DOC_PREFIX}/share/misc/docbook.css
|
|||
#
|
||||
NO_SUBDIR= YES
|
||||
|
||||
#
|
||||
# Determine latest revision
|
||||
#
|
||||
LATESTREVISION!=${GREP} -Ehos '\$$[F]reeBSD: ([^\$$ ]+ ){5}\$$' ${SRCS} | \
|
||||
${AWK} '{ print \
|
||||
" --param latestrevision.timestamp \"'\''"$$4" "$$5"'\''\"" \
|
||||
" --param latestrevision.committer \"'\''"$$6"'\''\"" \
|
||||
" --param latestrevision.number \"'\''"$$3"'\''\"" \
|
||||
}' | ${SORT} | ${TAIL} -n1
|
||||
|
||||
XSLTPROCOPTS+= ${LATESTREVISION}
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# Look at ${FORMATS} and work out which documents need to be generated.
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<xsl:variable name="pubdate">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(., '$FreeBSD')">
|
||||
<xsl:value-of select="str:split(., ' ')[4]"/>
|
||||
<xsl:value-of select="$latestrevision.timestamp"/>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
|
@ -64,7 +64,7 @@
|
|||
|
||||
<xsl:variable name="committer">
|
||||
<xsl:if test="contains(., '$FreeBSD')">
|
||||
<xsl:value-of select="str:split(., ' ')[6]"/>
|
||||
<xsl:value-of select="$latestrevision.committer"/>
|
||||
</xsl:if>
|
||||
</xsl:variable>
|
||||
|
||||
|
@ -91,7 +91,7 @@
|
|||
<xsl:template name="svnref.genlink"/>
|
||||
|
||||
<xsl:template name="titlepage.releaseinfo">
|
||||
<xsl:variable name="rev" select="str:split(., ' ')[3]"/>
|
||||
<xsl:variable name="rev" select="$latestrevision.number"/>
|
||||
|
||||
<xsl:call-template name="gentext">
|
||||
<xsl:with-param name="key" select="'Revision'"/>
|
||||
|
|
|
@ -264,7 +264,7 @@
|
|||
</xsl:template>
|
||||
|
||||
<xsl:template name="titlepage.releaseinfo">
|
||||
<xsl:variable name="rev" select="str:split(., ' ')[3]"/>
|
||||
<xsl:variable name="rev" select="$latestrevision.number"/>
|
||||
|
||||
<xsl:call-template name="gentext">
|
||||
<xsl:with-param name="key" select="'Revision'"/>
|
||||
|
|
Loading…
Reference in a new issue