git: 1e7c4a3928 - main - doc.docbook.mk: Fix LATESTREVISION determination, causes build failure on non-English locales

Daniel Ebdrup Jensen <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by debdrup:

URL: https://cgit.FreeBSD.org/doc/commit/?id=1e7c4a3928bf3b7d5edd89d6d8d02b8cbf0c865c

commit 1e7c4a3928bf3b7d5edd89d6d8d02b8cbf0c865c
Author:     Olivier Certner <[email protected]>
AuthorDate: 2021-01-19 12:04:38 +0000
Commit:     Daniel Ebdrup Jensen <[email protected]>
CommitDate: 2021-01-19 14:18:40 +0000

    doc.docbook.mk: Fix LATESTREVISION determination, causes build failure on non-English locales
    
    Fixes, e.g., manual articles/books build (i.e., typing `make` in the right
    directory).
    
    There were two problems:
    1. Git or SVN information retrieval depends on the current locale, and doesn't
    work with non-English ones.
    2. Fallback for LATESTREVISION most of the time (sometimes works, probable
    race) itself fails because PWD is set to document's directory + '/obj', but
    sources are in the document's directory.
    
    Problem 2 is the most annoying because documentation builds simply fails
    (`xsltproc` becomes unable to resolve 'latestrevision.*' variables in, e.g.,
    articles). But point 2's failure appears only because of point 1's failure,
    which doesn't happen on a machine with English or C locale.
    
    PR: 246936
---
 share/mk/doc.docbook.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/share/mk/doc.docbook.mk b/share/mk/doc.docbook.mk
index bcab2d712d..87512278e6 100644
--- a/share/mk/doc.docbook.mk
+++ b/share/mk/doc.docbook.mk
@@ -92,7 +92,7 @@ NO_SUBDIR=      YES
 # If using git, use git log.  The revision won't work with the generated links,
 # because it is a hash, and git log doesn't know about git svn find-rev.
 .if exists(${DOC_PREFIX}/.git) && exists(${GIT})
-LATESTREVISION!=cd ${.CURDIR} && ${GIT} log -1 --pretty=format:'\
+LATESTREVISION!=cd ${.CURDIR} && LC_ALL=C ${GIT} log -1 --pretty=format:'\
 	--stringparam latestrevision.timestamp "%ci" \
 	--stringparam latestrevision.committer "%cn" \
 	--stringparam latestrevision.number "%h"' ${SRCS}
@@ -102,7 +102,7 @@ LATESTREVISION!=cd ${.CURDIR} && ${GIT} log -1 --pretty=format:'\
 # the revision date from the timestamp of the most recent file and
 # set the revision number to "filedate"
 .if empty(LATESTREVISION)
-LATESTREVISION!=${STAT} 2>/dev/null -t '%F %T %Z' -f '\
+LATESTREVISION!=cd ${.CURDIR} && ${STAT} 2>/dev/null -t '%F %T %Z' -f '\
 	--stringparam latestrevision.timestamp "%Sc" \
 	--stringparam latestrevision.committer "%Su" \
 	--stringparam latestrevision.number "filedate"' \
@@ -719,4 +719,3 @@ ${LOCAL_CSS_SHEET}: ${CSS_SHEET}
 .endif
 
 HTML.manifest: index.html
-
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.