Attached, replacement patches.
From df1167cd4cef979379ef536ff928437444a5048f Mon Sep 17 00:00:00 2001 From: James Youngman <[email protected]> Date: Sat, 15 Nov 2025 22:52:23 +0000 Subject: [PATCH 1/3] [find] Use ASCII apostrophe in find.1 (instead of U+2019).
* find/find.1: Use ASCII apostrophe U+0027 instead of U+2019. --- find/find.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find/find.1 b/find/find.1 index a51a2f4b..82236a4b 100644 --- a/find/find.1 +++ b/find/find.1 @@ -2678,7 +2678,7 @@ A program appeared in Version 5 Unix as part of the Programmer's Workbench project and was written by Dick Haight. Doug McIlroy's -.I A Research UNIX Reader: Annotated Excerpts from the Programmer’s \ +.I A Research UNIX Reader: Annotated Excerpts from the Programmer's \ Manual, 1971\(en1986 provides some additional details; you can read it on-line at <https://www.cs.dartmouth.edu/~doug/reader.pdf>. -- 2.39.5
From 7d3e47e134777b2806aada6a0c737fe70ba9a289 Mon Sep 17 00:00:00 2001 From: James Youngman <[email protected]> Date: Sat, 15 Nov 2025 23:00:26 +0000 Subject: [PATCH 2/3] [find] Fix a lint problem in the find manual page. Without this fix, we get this error from `groff -C -t -z -ww -rCHECKSTYLE=2 -man find/find.1`: troff: find/find.1:2255: warning: macro '."' not defined troff: find/find.1:2255: warning: number register '[' not defined * find/find.1: revert a change which caused a lint warning from troff. --- find/find.1 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/find/find.1 b/find/find.1 index 82236a4b..17f5616f 100644 --- a/find/find.1 +++ b/find/find.1 @@ -2252,11 +2252,6 @@ and .SH EXAMPLES .\" A bulleted \[bu] list of examples. .SS Simple `find|xargs` approach -.\.".nr margin_n \n[an-margin]u/1n -.\"an-margin is \n[margin_n]n -.\".nr prev-indent_n \n[an-prevailing-indent]u/1n -.\"an-prevailing-indent] is \n[prev-indent_n]n -.\".br .IP \[bu] 4n Find files named .I core -- 2.39.5
From 9649ec7e00fa1f5f760c102c60b95f7b803680bb Mon Sep 17 00:00:00 2001 From: James Youngman <[email protected]> Date: Thu, 13 Nov 2025 22:13:18 +0000 Subject: [PATCH 3/3] [maint] Stricter manpage checks. From a suggestion by G. Branden Robinson to use `groff -t -z -ww -rCHECKSTYLE=2 -man`, by pointing to and example in https://lists.gnu.org/archive/html/bug-findutils/2025-11/msg00004.html. * configure.ac: discover the location of the groff binary. * build-aux/man-lint.sh: also run groff with -rCHECKSTYLE=2. Use groff at the path discovered during configuration. * find/Makefile.am: Lint-check manpages during "make check", not "make dist". Set the environment variable GROFF to the location of the groff binary. * locate/Makefile.am: Likewise. * xargs/Makefile.am: Likewise. --- build-aux/man-lint.sh | 70 +++++++++++++++++++++++++++++++++---------- configure.ac | 6 +++- find/Makefile.am | 4 +-- locate/Makefile.am | 4 +-- xargs/Makefile.am | 4 +-- 5 files changed, 66 insertions(+), 22 deletions(-) diff --git a/build-aux/man-lint.sh b/build-aux/man-lint.sh index 1ae1708d..17e6f3c4 100755 --- a/build-aux/man-lint.sh +++ b/build-aux/man-lint.sh @@ -14,20 +14,60 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -rv=0 +case "${GROFF}" in + :) + echo "groff is not installed, so we cannot check manual pages. Continuing without checking them." >&2 + exit 0 + ;; + "") + echo "The GROFF environment is not set; this is normally set when invoking this command from the Makefile; assuming GNU groff is at 'groff'." >&2 + GROFF=groff + ;; + *) + ;; +esac + srcdir="$1" ; shift -for manpage -do - what="lint check on manpage $manpage" - echo -n "$what: " - messages="$( groff -t -man ${srcdir}/${manpage} 2>&1 >/dev/null )" - if test -z "$messages" ; then - echo "passed" - else - echo "FAILED:" >&2 - echo "$messages" >&2 - rv=1 - fi -done -exit $rv +fixed_width_context_message_without_newline() { + printf '%-45s (%15s): ' "$1" "$2" +} + + +check_manpages_format_without_error_messages() { + for manpage + do + fixed_width_context_message_without_newline \ + 'check_manpages_format_without_error_messages' "${manpage}" + messages="$( ${GROFF} -t -man ${srcdir}/${manpage} 2>&1 >/dev/null )" + if test -z "$messages" + then + printf 'OK\n' + else + printf 'FAILED\n%s\n' "$messages" >&2 + return 1 + fi + done + return 0 +} + +check_manpages_with_groff_checkstyle_2() { + for manpage + do + fixed_width_context_message_without_newline \ + 'check_manpages_with_groff_checkstyle_2' "${manpage}" + messages="$( ${GROFF} -t -z -ww -rCHECKSTYLE=2 -man ${srcdir}/${manpage} 2>&1 )" + if test -z "$messages" + then + printf 'OK\n' + else + printf 'FAILED\n%s\n' "$messages" >&2 + return 1 + fi + done + return 0 +} + +rv=0 +check_manpages_format_without_error_messages "$@" && +check_manpages_with_groff_checkstyle_2 "$@" diff --git a/configure.ac b/configure.ac index 352f95f1..5f32c74f 100644 --- a/configure.ac +++ b/configure.ac @@ -101,7 +101,6 @@ dnl AC_PROG_LIBTOOL AC_PROG_MAKE_SET AC_SYS_LARGEFILE - gl_INIT AC_ARG_ENABLE(compiler-warnings, @@ -297,6 +296,11 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) AC_CHECK_PROGS([FAKETIME],[faketime],[:]) AM_CONDITIONAL([HAVE_FAKETIME], [test "$FAKETIME" != :]) +dnl Manpage linting. +AC_ARG_VAR(GROFF,[Location of GNU groff]) +AC_CHECK_PROGS([GROFF], [groff],[:]) + + # This is necessary so that .o files in LIBOBJS are also built via # the ANSI2KNR-filtering rules. #LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'` diff --git a/find/Makefile.am b/find/Makefile.am index 0454c03f..4d8bb2de 100644 --- a/find/Makefile.am +++ b/find/Makefile.am @@ -40,7 +40,7 @@ SUBDIRS = . testsuite noinst_PROGRAMS = getlimits -dist-hook: findutils-check-manpages +check-local: findutils-check-manpages # Clean coverage files generated by running binaries built with # gcc -fprofile-arcs -ftest-coverage @@ -50,4 +50,4 @@ coverage-clean: clean-local: coverage-clean findutils-check-manpages: - $(top_srcdir)/build-aux/man-lint.sh $(srcdir) $(man_MANS) + env GROFF=$(GROFF) $(top_srcdir)/build-aux/man-lint.sh $(srcdir) $(man_MANS) diff --git a/locate/Makefile.am b/locate/Makefile.am index c812ea97..183b9532 100644 --- a/locate/Makefile.am +++ b/locate/Makefile.am @@ -79,10 +79,10 @@ dblocation.texi: SUBDIRS = . testsuite -dist-hook: findutils-check-manpages +check-local: findutils-check-manpages findutils-check-manpages: - $(top_srcdir)/build-aux/man-lint.sh $(srcdir) $(man_MANS) + env GROFF=$(GROFF) $(top_srcdir)/build-aux/man-lint.sh $(srcdir) $(man_MANS) # Clean coverage files generated by running binaries built with # gcc -fprofile-arcs -ftest-coverage diff --git a/xargs/Makefile.am b/xargs/Makefile.am index ddf2091c..2703cce5 100644 --- a/xargs/Makefile.am +++ b/xargs/Makefile.am @@ -25,10 +25,10 @@ SUBDIRS = . testsuite $(PROGRAMS): ../lib/libfind.a ../gl/lib/libgnulib.a -dist-hook: findutils-check-manpages +check-local: findutils-check-manpages findutils-check-manpages: - $(top_srcdir)/build-aux/man-lint.sh $(srcdir) $(man_MANS) + env GROFF=$(GROFF) $(top_srcdir)/build-aux/man-lint.sh $(srcdir) $(man_MANS) # Clean coverage files generated by running binaries built with # gcc -fprofile-arcs -ftest-coverage -- 2.39.5
