diff options
author | J William Piggott | 2015-01-13 02:30:01 +0100 |
---|---|---|
committer | J William Piggott | 2015-01-13 17:43:45 +0100 |
commit | 7d2ba7ad234d0a33232c0d7728a36eb127f1484b (patch) | |
tree | 21b7b8220ab7040bb6a81c3e3262eb359e451e20 /tools | |
parent | tools: checkman.sh portability lexgrog (diff) | |
download | kernel-qcow2-util-linux-7d2ba7ad234d0a33232c0d7728a36eb127f1484b.tar.gz kernel-qcow2-util-linux-7d2ba7ad234d0a33232c0d7728a36eb127f1484b.tar.xz kernel-qcow2-util-linux-7d2ba7ad234d0a33232c0d7728a36eb127f1484b.zip |
tools: checkmans.sh clean up 'let'
Clean up 'let' issues and loop iteration.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/checkmans.sh | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tools/checkmans.sh b/tools/checkmans.sh index 513a7507d..bd2bc4385 100755 --- a/tools/checkmans.sh +++ b/tools/checkmans.sh @@ -42,7 +42,8 @@ done # Try to find missing manuals matching build targets with manual files. declare -A MAN_LIST BIN_LIST -COUNT_ERRORS=0 +declare -i ITER +declare -i COUNT_ERRORS=0 declare -a REPEATS declare -A KNOWN_REPEATS KNOWN_REPEATS[mount.8]='foo' @@ -111,21 +112,14 @@ for I in $( sed -e 's/\s\+/\n/g; /^$/d' | awk 'BEGIN { p="" } { if (0 < length($0)) { if (p == $0) { print } } p = $0 }') ) if [ 0 -lt "${#REPEATS[@]}" ]; then - ITER=${#REPEATS[@]} - while [ -1 -lt ${ITER} ]; do + ITER=${#REPEATS[@]}+1 + while ((ITER--)); do remove_repeats ${ITER} - # The 'let' may cause exit on error. - # When ITER == 0 -> let returns 1, bash bug? - let ITER=${ITER}-1 || true done if [ 0 -lt "${#REPEATS[@]}" ]; then echo "warning: ${I} has repeating words: ${REPEATS[@]}" fi fi - # The 'let' may cause exit on error. - # COUNT_ERRORS=0; let COUNT_ERRORS=$COUNT_ERRORS+0; echo $? - # Is this a bash bug? - let COUNT_ERRORS=$COUNT_ERRORS+$I_ERR || true done # Create a list of build targets. |