Parsing du log plus rapide

This commit is contained in:
Maniack Crudelis 2017-05-01 15:33:33 +02:00
parent 26c123b2f2
commit 44f9e95348
2 changed files with 6 additions and 22 deletions

View file

@ -613,7 +613,7 @@ TEST_RESULTS () {
then then
# If the app have been picked from github, check if this app was under the YunoHost-Apps organisation # If the app have been picked from github, check if this app was under the YunoHost-Apps organisation
# YEP17 will be equal to 1 if the app was under the YunoHost-Apps organisation # YEP17 will be equal to 1 if the app was under the YunoHost-Apps organisation
YEP17=$(echo "$app_arg" | grep --count "github.com/YunoHost-Apps/") YEP17=$(echo "$app_arg" | grep --ignore-case --count "github.com/YunoHost-Apps/")
[ $YEP17 -eq 1 ] || ECHO_FORMAT "This app doesn't respect the YEP 1.7 ! (https://yunohost.org/#/packaging_apps_guidelines_fr)\n" "red" [ $YEP17 -eq 1 ] || ECHO_FORMAT "This app doesn't respect the YEP 1.7 ! (https://yunohost.org/#/packaging_apps_guidelines_fr)\n" "red"
fi fi

View file

@ -103,27 +103,11 @@ LOG_EXTRACTOR () {
> "$temp_result" > "$temp_result"
# Duplicate the part of the yunohost log into the complete log. # Duplicate the part of the yunohost log into the complete log.
cat "$temp_log" >> "$complete_log" cat "$temp_log" >> "$complete_log"
while read log_read_line # Find all errors and warnings in the log file
do grep --extended-regexp " ERROR | WARNING |yunohost.*: error:" "$temp_log" >> "$temp_result"
if echo "$log_read_line" | grep --quiet " ERROR " sed -i 's/^.* ERROR */>ERROR: /' "$temp_result"
then sed -i 's/^.* WARNING */>WARNING: /' "$temp_result"
# Copy in the temporary result file all logged error
echo -n ">ERROR: " >> "$temp_result"
echo "$log_read_line" | sed 's/^.* ERROR *//' >> "$temp_result"
fi
if echo "$log_read_line" | grep --quiet "yunohost.*: error:"
then
# Also copy the moulinette errors
echo -n ">ERROR: " >> "$temp_result"
echo "$log_read_line" >> "$temp_result"
fi
if echo "$log_read_line" | grep --quiet " WARNING "
then
# And all logged warning
echo -n ">WARNING: " >> "$temp_result"
echo "$log_read_line" | sed 's/^.* WARNING *//' >> "$temp_result"
fi
done < "$temp_log"
CLEAR_LOG # Remove all knew useless warning lines. CLEAR_LOG # Remove all knew useless warning lines.
PARSE_LOG # Print all errors and warning found in the log. PARSE_LOG # Print all errors and warning found in the log.
} }