summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJ William Piggott2015-01-12 21:19:45 +0100
committerJ William Piggott2015-01-13 17:43:45 +0100
commit34317b92921b4e26c8f5d22603c5bfa726b775db (patch)
treec5b0335aa01b15d6a4263b697226d2821feca630 /tools
parenttools: checkman.sh portability (diff)
downloadkernel-qcow2-util-linux-34317b92921b4e26c8f5d22603c5bfa726b775db.tar.gz
kernel-qcow2-util-linux-34317b92921b4e26c8f5d22603c5bfa726b775db.tar.xz
kernel-qcow2-util-linux-34317b92921b4e26c8f5d22603c5bfa726b775db.zip
tools: checkman.sh portability lexgrog
checkman.sh depends upon the man-db package: Add using grog when lexgrog not installed. /dev/null some troff noise. Signed-off-by: J William Piggott <elseifthen@gmx.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkmans.sh26
1 files changed, 21 insertions, 5 deletions
diff --git a/tools/checkmans.sh b/tools/checkmans.sh
index 6b80853cc..513a7507d 100755
--- a/tools/checkmans.sh
+++ b/tools/checkmans.sh
@@ -90,11 +90,23 @@ for I in $(
echo "From: cat ${I} | troff -mandoc -ww -z"
echo "=================================================="
fi
- if ! lexgrog ${I} >/dev/null; then
- echo "error: run: lexgrog ${I}" >&2
- I_ERR=1
+ GROG=1
+ if command -v lexgrog &> /dev/null; then
+ if ! lexgrog ${I} >/dev/null; then
+ echo "error: run: lexgrog ${I}"
+ echo "=================================================="
+ ((++COUNT_ERRORS))
+ fi
+ elif command -v grog &> /dev/null; then
+ if ! grog ${I} | grep man >/dev/null; then
+ echo "error: grog ${I} is not a man file"
+ echo "=================================================="
+ ((++COUNT_ERRORS))
+ fi
+ else
+ GROG=0
fi
- REPEATS=( $(cat ${I} | troff -mandoc -ww -Tascii | grotty |
+ REPEATS=( $(cat ${I} | troff -mandoc -Tascii 2>/dev/null | grotty |
col -b |
sed -e 's/\s\+/\n/g; /^$/d' |
awk 'BEGIN { p="" } { if (0 < length($0)) { if (p == $0) { print } } p = $0 }') )
@@ -147,8 +159,12 @@ for I in ${!BIN_LIST[@]}; do
done
set -u
+if [ ${GROG} = 0 ]; then
+echo "warning: neither grog nor lexgrog commands were found"
+fi
+
if [ ${COUNT_ERRORS} -ne 0 ]; then
- echo "error: ${SCRIPT_INVOCATION_SHORT_NAME}: ${COUNT_ERRORS} manuals failed" >&2
+ echo "error: ${SCRIPT_INVOCATION_SHORT_NAME}: ${COUNT_ERRORS} manuals failed"
exit 1
fi