Skip to content

Commit 1151920

Browse files
authored
Merge pull request #3260 from jimklimov/issue-3255
Fix driver man page listing to not include snippets
2 parents 71e88b4 + 0046246 commit 1151920

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

docs/man/Makefile.am

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,7 @@ SRC_ALL_PAGES += \
15201520
$(SRC_CGI_PAGES) \
15211521
$(SRC_DEV_PAGES) \
15221522
$(SRC_DRIVERS_PAGES) \
1523-
networked_hostnames.txt \
1524-
index.txt
1523+
networked_hostnames.txt
15251524

15261525
# DIST_ALL_PAGES: Make sure pages are built for the archive (or
15271526
# inherited from earlier tarball this release is being built from);
@@ -1596,6 +1595,11 @@ endif !WITH_HTML_SINGLE
15961595
# (sockdebug), or platform-specific progs (nut.exe)
15971596
LINKMAN_INCLUDE_GENERATED = linkman-driver-names.txt linkman-drivertool-names.txt linkman-docbuildmode-note.txt
15981597
LINKMAN_INCLUDE_CONSUMERS = index.txt upsd.txt nutupsdrv.txt nut.txt
1598+
# Files that linkman-driver-names.txt would consider from LINKMAN_PAGES_DRIVERS
1599+
# that are only included snippets but not standalone driver pages.
1600+
# TOTHINK: Parse sources for `include::` hits dynamically to build (parts of) this regex?
1601+
LINKMAN_EXCLUDE_NONDRIVER = '^(nutupsdrv|blazer-common|nut_usb_addvars|networked_hostnames)\.txt$$'
1602+
15991603
CLEANFILES = linkman-*.txt.tmp*
16001604

16011605
# Note we can have a pre-built file from the tarball, sort of useful when
@@ -1606,7 +1610,7 @@ linkman-driver-names.txt: Makefile
16061610
@echo " GENERATE-LINKMAN $@"
16071611
@(LC_ALL=C; LANG=C; export LC_ALL LANG; \
16081612
for F in $(LINKMAN_PAGES_DRIVERS) ; do echo "$$F" ; done \
1609-
| $(EGREP) -v '^nutupsdrv\.txt$$' \
1613+
| $(EGREP) -v $(LINKMAN_EXCLUDE_NONDRIVER) \
16101614
| sort -n | uniq \
16111615
| sed 's,^\(.*\)\.txt$$,- linkman:\1[$(MAN_SECTION_CMD_SYS)],' ; \
16121616
) > "$(builddir)/$(@F).tmp.$$$$" || exit ; \

tools/driver-list-format.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# Copyright (C)
99
# 2015-2016 Arnaud Quette <arnaud.quette@free.fr>
10-
# 2025 Jim Klimov <jimklimov+nut@gmail.com>
10+
# 2025-2026 Jim Klimov <jimklimov+nut@gmail.com>
1111
#
1212
################################################################################
1313

@@ -86,7 +86,7 @@ do
8686
# the fields may be empty (just two double-quotes).
8787
BADLINES="`$EGREP -v \"${VALID_LINE}\" < \"${TMPBUILD_PATH}/${drvfile}.tabbed\"`"
8888
if [ x"${BADLINES}" != x ] ; then
89-
echo "$0: ERROR: markup of '${DRVLIST_PATH}/${drvfile}' needs to be fixed: some lines are not exactly 6 fields (and optional comment)" >&2
89+
echo "$0: ERROR: markup of '${DRVLIST_PATH}/${drvfile}' needs to be fixed: some lines are not exactly 6 fields wrapped in quotes (and optional comment) and separated by TAB characters" >&2
9090
echo "$BADLINES" | head -5
9191
RES=1
9292
false

0 commit comments

Comments
 (0)