2017-09-22 02:55:15 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# run the filter-known-issues.py script to remove "expected" warning
|
|
|
|
# messages from the output of the document build process and write
|
|
|
|
# the filtered output to stdout
|
|
|
|
#
|
|
|
|
# Only argument is the name of the log file saved by the build.
|
|
|
|
|
|
|
|
KI_SCRIPT=${ZEPHYR_BASE}/scripts/filter-known-issues.py
|
|
|
|
CONFIG_DIR=${ZEPHYR_BASE}/.known-issues/doc
|
|
|
|
|
|
|
|
LOG_FILE=$1
|
|
|
|
|
|
|
|
if [ -z "${LOG_FILE}" ]; then
|
|
|
|
echo "Error in $0: missing input parameter <logfile>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-12-14 04:28:46 +08:00
|
|
|
# When running in background, detached from terminal jobs, tput will
|
|
|
|
# fail; we usually can tell because there is no TERM env variable.
|
2017-12-22 18:28:13 +08:00
|
|
|
if [ -z "${TERM:-}" -o "${TERM:-}" = dumb ]; then
|
2017-12-14 04:28:46 +08:00
|
|
|
TPUT="true"
|
2017-12-22 18:28:13 +08:00
|
|
|
red=''
|
|
|
|
green=''
|
2017-12-14 04:28:46 +08:00
|
|
|
else
|
|
|
|
TPUT="tput"
|
2017-12-22 18:28:13 +08:00
|
|
|
red='\E[31m'
|
|
|
|
green='\e[32m'
|
2017-12-14 04:28:46 +08:00
|
|
|
fi
|
|
|
|
|
2017-11-11 23:02:00 +08:00
|
|
|
if [ -s "${LOG_FILE}" ]; then
|
|
|
|
$KI_SCRIPT --config-dir ${CONFIG_DIR} ${LOG_FILE} > doc.warnings 2>&1
|
|
|
|
if [ -s doc.warnings ]; then
|
|
|
|
echo
|
|
|
|
echo -e "${red}New errors/warnings found, please fix them:"
|
|
|
|
echo -e "=============================================="
|
2017-12-14 04:28:46 +08:00
|
|
|
$TPUT sgr0
|
2017-11-11 23:02:00 +08:00
|
|
|
echo
|
|
|
|
cat doc.warnings
|
|
|
|
echo
|
|
|
|
else
|
|
|
|
echo -e "${green}No new errors/warnings."
|
2017-12-14 04:28:46 +08:00
|
|
|
$TPUT sgr0
|
2017-09-22 02:55:15 +08:00
|
|
|
fi
|
2017-11-11 23:02:00 +08:00
|
|
|
|
2017-09-22 02:55:15 +08:00
|
|
|
else
|
|
|
|
echo "Error in $0: logfile \"${LOG_FILE}\" not found."
|
|
|
|
exit 1
|
|
|
|
fi
|