| #!/bin/bash |
| |
| if [ $# -ne 1 ] |
| then |
| echo "usage: $(basename $0) file" >&2 |
| exit 1 |
| fi |
| |
| REPORT=$1 |
| |
| POOL=$(sed -e 's/^pool //' -e q $REPORT) |
| cat <<END |
| Status of pool:$POOL inventory, by board: |
| |
| END |
| |
| FMT="%-15s %7s %7s\n" |
| printf "$FMT" "BOARD" "WORKING" "TOTAL" |
| awk ' |
| /^board / { |
| board = $2 |
| total[board] = working[board] = 0 |
| } |
| /^chrome/ { |
| total[board]++ |
| } |
| /^chrome.*OK/ { |
| working[board]++ |
| } |
| { next } |
| END { |
| reported = 0 |
| for (board in total) { |
| if (working[board] != total[board]) { |
| printf "'"$FMT"'", board, working[board], total[board] |
| reported++ |
| } |
| } |
| if (reported == 0) { |
| print "(all boards at full strength)" |
| } |
| } |
| ' $REPORT | sort -nk 2 |