From 7c7eca2fab5a5a548c08b3ad48030788b8cb853b Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Thu, 14 Feb 2019 15:08:01 -0800 Subject: Improve error detection ... by filtering the messages that contain a *word* "warning" or "error", i.e. is preceded by a space or is at the beginning of the line. This improves the output from new uClibc-ng releases - which produce a warning about an unused label, `mprot_error`. Signed-off-by: Alexey Neyman diff --git a/scripts/functions b/scripts/functions index f71ea04..e577b9d 100644 --- a/scripts/functions +++ b/scripts/functions @@ -283,13 +283,15 @@ CT_DoLog() { _prog_bar[3]='|' indent=$((2*CT_STEP_COUNT)) while read line; do - case "${CT_LOG_SEE_TOOLS_WARN},${line}" in - y,*"warning:"*) cur_L=WARN; cur_l=${CT_LOG_LEVEL_WARN};; - y,*"WARNING:"*) cur_L=WARN; cur_l=${CT_LOG_LEVEL_WARN};; - *"error:"*) cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; - *"Error:"*) cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; - *"make["*"]: ***"*) cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; - *) cur_L="${LEVEL}"; cur_l="${level}";; + case "${CT_LOG_SEE_TOOLS_WARN:-n},${line}" in + y,*[[:space:]][Ww]arning:*|y,[Ww]arning:*|y,*[[:space:]]WARNING:*|y,WARNING:*) + cur_L=WARN; cur_l=${CT_LOG_LEVEL_WARN};; + *[[:space:]][Ee]rror:*|[yn],[Ee]rror:*) + cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; + *"make["*"]: ***"*) + cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};; + *) + cur_L="${LEVEL}"; cur_l="${level}";; esac # There will always be a log file (stdout, fd #1), be it /dev/null if [ -n "${CT_LOG_ENABLED}" ]; then -- cgit v0.10.2-6-g49f6