summaryrefslogtreecommitdiff
path: root/man/check-man
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2023-09-23 22:11:07 +0100
committerColin Watson <cjwatson@debian.org>2023-09-23 22:11:07 +0100
commit10ffa2be71a9ba46c4328b3792a2001f4092625d (patch)
treec643da154a95a1d163137135050bb47858a1654e /man/check-man
parent0a730625ad4880fdd63fc21efb1b18966042c2f4 (diff)
parent407693f34f450050ecdbe9ad3147c8afa0e7616b (diff)
Import man-db_2.12.0.orig.tar.xz
Diffstat (limited to 'man/check-man')
-rwxr-xr-xman/check-man25
1 files changed, 12 insertions, 13 deletions
diff --git a/man/check-man b/man/check-man
index a58b7f9d..b28e039c 100755
--- a/man/check-man
+++ b/man/check-man
@@ -2,8 +2,8 @@
set -e
# Check that a manual page formats without errors. Lintian does something
-# similar for Debian packages. Relies on top_builddir, LINGUA, and EGREP
-# variables exported from 'make check', or you can set them manually.
+# similar for Debian packages. Relies on top_builddir and LINGUA variables
+# exported from 'make check', or you can set them manually.
if [ -z "$top_builddir" ]; then
echo "top_builddir unset; try 'make check' instead?"
@@ -11,28 +11,27 @@ if [ -z "$top_builddir" ]; then
elif [ -z "$LINGUA" ]; then
echo "LINGUA unset; try 'make check' instead?"
exit 77
-elif [ -z "$EGREP" ]; then
- echo "EGREP unset; try 'make check' instead?"
- exit 77
fi
[ -x "$top_builddir/src/man" ] || exit 77
+warnings=mac
+# Ignore wrapping failures for CJK manual pages; this should go away once
+# groff supports these natively.
+# Indeed, even for other languages we're going to get "cannot adjust line"
+# if %manpath_config_file% expands to something long. Hmm. We'll just ignore
+# this across the board for now.
+warnings="$warnings,!break"
+
code=0
errors="$(LC_ALL=C MANWIDTH=80 MAN_KEEP_FORMATTING=1 "$top_builddir/libtool" \
--mode=execute \
-dlopen "$top_builddir/lib/.libs/libman.la" \
-dlopen "$top_builddir/libdb/.libs/libmandb.la" \
- "$top_builddir/src/man" --warnings -E UTF-8 -l "$1" \
+ "$top_builddir/src/man" --warnings="$warnings" -E UTF-8 \
+ -l "$1" \
2>&1 >/dev/null)" || code=$?
-# Ignore wrapping failures for CJK manual pages; this should go away once
-# groff supports these natively.
-# Indeed, even for other languages we're going to get "cannot adjust line"
-# if %manpath_config_file% expands to something long. Hmm. We'll just ignore
-# this across the board for now.
-errors="$(echo "$errors" | $EGREP -v "(cannot adjust line|can't break line)")" || true
-
if [ "$code" != 0 ]; then
echo "man -E UTF-8 -l $1 failed with exit status $code and error output:"
echo "$errors"