check-warnings 436 B

12345678910111213141516171819
  1. #! /bin/bash
  2. # Expects the path to a log file as $1, and if this file has any content
  3. # then display the contents and exit with an error code.
  4. set -e -u
  5. LOGFILE=$1
  6. LINES=$(grep --invert-match "attempting MIRRORS if available" $LOGFILE | wc -l)
  7. if test "$LINES" -ne 0; then
  8. echo ==============================
  9. echo The build had warnings/errors:
  10. echo ==============================
  11. cat $LOGFILE
  12. exit 1
  13. fi
  14. exit 0