From: JWP <elseifthen@gmx.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org, Sami Kerola <kerolasa@iki.fi>
Subject: [PATCH 2/4] tools: checkman.sh portability lexgrog
Date: Tue, 13 Jan 2015 13:57:48 -0500 [thread overview]
Message-ID: <54B56AAC.8000302@gmx.com> (raw)
In-Reply-To: <54B56822.40805@gmx.com>
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>
---
tools/checkmans.sh | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/tools/checkmans.sh b/tools/checkmans.sh
index 6b80853..513a750 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
next prev parent reply other threads:[~2015-01-13 18:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 18:46 [PATCH 0/4] tools: checkman.sh portability JWP
2015-01-13 18:55 ` [PATCH 1/4] " JWP
2015-01-13 18:57 ` JWP [this message]
2015-01-13 18:59 ` [PATCH 3/4] tools: checkmans.sh clean up 'let' JWP
2015-01-13 19:02 ` [PATCH 4/4] tools: checkmans.sh add stats JWP
2015-01-14 9:26 ` [PATCH 0/4] tools: checkman.sh portability Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54B56AAC.8000302@gmx.com \
--to=elseifthen@gmx.com \
--cc=kerolasa@iki.fi \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.