From: ng0 Date: Mon, 4 Mar 2019 14:37:50 +0000 (+0000) Subject: safety checks for lint-man.sh X-Git-Tag: v0.11.1~175 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=25af6d913578ed7176d22d0eb187ad2a70d49374;p=oweals%2Fgnunet.git safety checks for lint-man.sh --- diff --git a/Makefile.am b/Makefile.am index daa2946a7..3c1d8c8fc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,3 +42,5 @@ check-python: check-man: printf "Running lint-man.sh in doc/man.\n" @cd $(top_srcdir)/doc/man ; $(top_srcdir)/../../contrib/scripts/lint-man.sh || true + +check-linters: check-bashism check-python check-man diff --git a/contrib/scripts/lint-man.sh b/contrib/scripts/lint-man.sh index 6a9f544f4..1a3f1514a 100755 --- a/contrib/scripts/lint-man.sh +++ b/contrib/scripts/lint-man.sh @@ -3,16 +3,29 @@ # SPDX-License-Identifier: 0BSD # spit out ONLY error messages using groff. -echo "groff check" -for f in `find . -name \*\.[1-9]`; -do - LC_ALL=en_US.UTF-8 \ - MANROFFSEQ='' \ - MANWIDTH=80 \ - groff -m mandoc -b -z -w w $f; -done +existence() +{ + command -v "$1" >/dev/null 2>&1 +} + +if existence groff; +then + echo "groff check" + for f in `find . -name \*\.[1-9]`; + do + LC_ALL=en_US.UTF-8 \ + MANROFFSEQ='' \ + MANWIDTH=80 \ + groff -m mandoc -b -z -w w $f; + done +fi + echo "mandoc check" # spit out ONLY error messages with mandoc: -mandoc -T lint `find . -name \*\.[1-9]` +if existence mandoc; +then + mandoc -T lint `find . -name \*\.[1-9]` +fi + #LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 /run/current-system/profile/bin/man --warnings -E UTF-8 -l -Tutf8 -Z <*.5> >report5.log #LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 /run/current-system/profile/bin/man --warnings -E UTF-8 -l -Tutf8 -Z <*.1> >report1.log