summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKarel Zak2018-03-01 13:52:07 +0100
committerKarel Zak2018-03-01 13:52:07 +0100
commit1007fb6d9c74bc36e745436a2cdc9b357dbb718c (patch)
tree9189f8dff80cd9183310223cc311be698e109f3b /tools
parentdocs: add note about NVMe-multipath to TODO (diff)
downloadkernel-qcow2-util-linux-1007fb6d9c74bc36e745436a2cdc9b357dbb718c.tar.gz
kernel-qcow2-util-linux-1007fb6d9c74bc36e745436a2cdc9b357dbb718c.tar.xz
kernel-qcow2-util-linux-1007fb6d9c74bc36e745436a2cdc9b357dbb718c.zip
tools: improve checkmans
* ignore .git/ * don't print error messages when error counters are zero * add new KNOWN_REPEATS[] Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkmans.sh19
1 files changed, 13 insertions, 6 deletions
diff --git a/tools/checkmans.sh b/tools/checkmans.sh
index 63da3d73e..a48549e0d 100755
--- a/tools/checkmans.sh
+++ b/tools/checkmans.sh
@@ -48,10 +48,11 @@ declare -i COUNT_TROFF=0
declare -i COUNT_REPEATS=0
declare -a REPEATS
declare -A KNOWN_REPEATS
-KNOWN_REPEATS[mount.8]='foo l2 l c'
+KNOWN_REPEATS[mount.8]='foo l2 l c overlay'
KNOWN_REPEATS[hexdump.1]='l'
KNOWN_REPEATS[flock.1]='"$0"'
KNOWN_REPEATS[switch_root.8]='$DIR'
+KNOWN_REPEATS[logger.1]='-'
remove_repeats()
{
@@ -70,7 +71,7 @@ remove_repeats()
cd $(git rev-parse --show-toplevel)
for I in $(
- find . -type f -name '*[[:alpha:]].[1-8]' |grep -v "autom4te.cache\|\.libs/"
+ find . -type f -name '*[[:alpha:]].[1-8]' |grep -v "autom4te.cache\|\.libs/\|\.git"
); do
MAN_FILE=${I##*/}
MAN_LIST[${MAN_FILE%%.[0-9]}]=1
@@ -164,17 +165,23 @@ if [ ${GROG} = 0 ]; then
echo "warning: neither grog nor lexgrog commands were found"
fi
-if [ ${COUNT_GROG} -ne 0 -o ${COUNT_TROFF} -ne 0 -o ${COUNT_REPEATS} -ne 0 ]; then
+if [ ${COUNT_GROG} -ne 0 ]; then
echo "error: ${SCRIPT_INVOCATION_SHORT_NAME}: ${COUNT_GROG} files failed (lex)grog man-page test"
+fi
+if [ ${COUNT_TROFF} -ne 0 ]; then
echo "error: ${SCRIPT_INVOCATION_SHORT_NAME}: ${COUNT_TROFF} files failed troff parsing test"
+fi
+if [ ${COUNT_REPEATS} -ne 0 ]; then
echo "error: ${SCRIPT_INVOCATION_SHORT_NAME}: ${COUNT_REPEATS} files have repeating words"
- ITER=${#MAN_LIST[*]}-${COUNT_GROG}-${COUNT_TROFF}-${COUNT_REPEATS}
- echo "${SCRIPT_INVOCATION_SHORT_NAME}: ${ITER} man-pages approved"
+fi
+ITER=${#MAN_LIST[*]}-${COUNT_GROG}-${COUNT_TROFF}-${COUNT_REPEATS}
+echo "${SCRIPT_INVOCATION_SHORT_NAME}: ${ITER} man-pages approved"
+
+if [ ${COUNT_GROG} -ne 0 -o ${COUNT_TROFF} -ne 0 -o ${COUNT_REPEATS} -ne 0 ]; then
exit 1
fi
if ! ${VERBOSE}; then
echo "${SCRIPT_INVOCATION_SHORT_NAME}: success"
fi
-
exit 0