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>
This commit is contained in:
parent
56f4d6ce0d
commit
1007fb6d9c
1 changed files with 13 additions and 6 deletions
|
@ -48,10 +48,11 @@ declare -i COUNT_TROFF=0
|
||||||
declare -i COUNT_REPEATS=0
|
declare -i COUNT_REPEATS=0
|
||||||
declare -a REPEATS
|
declare -a REPEATS
|
||||||
declare -A KNOWN_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[hexdump.1]='l'
|
||||||
KNOWN_REPEATS[flock.1]='"$0"'
|
KNOWN_REPEATS[flock.1]='"$0"'
|
||||||
KNOWN_REPEATS[switch_root.8]='$DIR'
|
KNOWN_REPEATS[switch_root.8]='$DIR'
|
||||||
|
KNOWN_REPEATS[logger.1]='-'
|
||||||
|
|
||||||
remove_repeats()
|
remove_repeats()
|
||||||
{
|
{
|
||||||
|
@ -70,7 +71,7 @@ remove_repeats()
|
||||||
cd $(git rev-parse --show-toplevel)
|
cd $(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
for I in $(
|
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
|
); do
|
||||||
MAN_FILE=${I##*/}
|
MAN_FILE=${I##*/}
|
||||||
MAN_LIST[${MAN_FILE%%.[0-9]}]=1
|
MAN_LIST[${MAN_FILE%%.[0-9]}]=1
|
||||||
|
@ -164,17 +165,23 @@ if [ ${GROG} = 0 ]; then
|
||||||
echo "warning: neither grog nor lexgrog commands were found"
|
echo "warning: neither grog nor lexgrog commands were found"
|
||||||
fi
|
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"
|
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"
|
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"
|
echo "error: ${SCRIPT_INVOCATION_SHORT_NAME}: ${COUNT_REPEATS} files have repeating words"
|
||||||
ITER=${#MAN_LIST[*]}-${COUNT_GROG}-${COUNT_TROFF}-${COUNT_REPEATS}
|
fi
|
||||||
echo "${SCRIPT_INVOCATION_SHORT_NAME}: ${ITER} man-pages approved"
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! ${VERBOSE}; then
|
if ! ${VERBOSE}; then
|
||||||
echo "${SCRIPT_INVOCATION_SHORT_NAME}: success"
|
echo "${SCRIPT_INVOCATION_SHORT_NAME}: success"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue