1
0

fix log parsing, terminate if there no packages

This commit is contained in:
GenZmeY 2022-03-24 05:42:57 +03:00
parent 51bb86828f
commit b250635f88

52
builder
View File

@ -270,6 +270,10 @@ function init ()
fi fi
done < <(find "$MutSource" -mindepth 2 -maxdepth 2 -type d -ipath '*/Classes' | sed -r 's|.+/([^/]+)/[^/]+|\1|' | sort) done < <(find "$MutSource" -mindepth 2 -maxdepth 2 -type d -ipath '*/Classes' | sed -r 's|.+/([^/]+)/[^/]+|\1|' | sort)
if [[ -z "$PackageList" ]]; then
die "No packages found! Check project filesystem, fix config and try again"
fi
msg "packages found: $PackageList" msg "packages found: $PackageList"
for Package in $PackageList for Package in $PackageList
@ -501,38 +505,42 @@ function parse_log () # $1: Logfile
local Line='' local Line=''
local Message='' local Message=''
local IR=1 local I=1
if grep -qP ' Error:.+: Error, ' "$1"; then # check to prevent a very strange crash if grep -qP ' Error:(.+:)? Error, ' "$1"; then # check to prevent a very strange crash
grep -P ' Error:.+: Error, ' "$1" | \
while read -r Error while read -r Error
do do
if [[ -z "$Error" ]]; then break; fi if [[ -z "$Error" ]]; then break; fi
File="$(echo "$Error" | sed -r 's|^.+Error: (.+)\([0-9]+\) : Error,.+$|\1|')" Message="$(echo "$Error" | sed -r 's|^.+Error:.+Error, (.+)$|\1|')"
File="$(echo "$Error" | sed -r 's|^.+Error: ((.+)\(([0-9]+)\) : )?Error,(.+)$|\2|')"
if [[ -n "$File" ]]; then
FileUnix="$(cygpath -u "$File")" FileUnix="$(cygpath -u "$File")"
FileCompact="$(echo "$FileUnix" | sed -r "s|^$KFDev(.+)$|\1|")" FileCompact="$(echo "$FileUnix" | sed -r "s|^$KFDev(.+)$|\1|")"
Line="$(echo "$Error" | sed -r 's|^.+Error: .+\(([0-9]+)\) : Error,.+$|\1|')" Line="$(echo "$Error" | sed -r 's|^.+Error: ((.+)\(([0-9]+)\) : )?Error,(.+)$|\3|')"
Message="$(echo "$Error" | sed -r 's|^.+Error: .+\([0-9]+\) : Error, (.+)$|\1|')" msg "${RED}[$I] $FileCompact($Line): $Message"
else
msg "${RED}[$IR] $FileCompact($Line): $Message" msg "${RED}[$I] $Message"
((IR+=1)) fi
done ((I+=1))
done < <(grep -P ' Error:(.+:)? Error, ' "$1")
fi fi
local IW=1 if grep -qP ' Warning:(.+:)? Warning, ' "$1"; then # and here too
if grep -qP ' Warning:.+: Warning, ' "$1"; then # and here too
grep -P ' Warning:.+: Warning, ' "$1" | \
while read -r Warning while read -r Warning
do do
if [[ -z "$Warning" ]]; then break; fi if [[ -z "$Warning" ]]; then break; fi
File="$(echo "$Warning" | sed -r 's|^.+Warning: (.+)\([0-9]+\) : Warning,.+$|\1|')" Message="$(echo "$Warning" | sed -r 's|^.+Warning:.+Warning, (.+)$|\1|')"
if echo "$Message" | grep -qF 'Unknown language extension . Defaulting to INT'; then continue; fi
File="$(echo "$Warning" | sed -r 's|^.+Warning: ((.+)\(([0-9]+)\) : )?Warning,(.+)$|\2|')"
if [[ -n "$File" ]]; then
FileUnix="$(cygpath -u "$File")" FileUnix="$(cygpath -u "$File")"
FileCompact="$(echo "$FileUnix" | sed -r "s|^$KFDev(.+)$|\1|")" FileCompact="$(echo "$FileUnix" | sed -r "s|^$KFDev(.+)$|\1|")"
Line="$(echo "$Warning" | sed -r 's|^.+Warning: .+\(([0-9]+)\) : Warning,.+$|\1|')" Line="$(echo "$Warning" | sed -r 's|^.+Warning: ((.+)\(([0-9]+)\) : )?Warning,(.+)$|\3|')"
Message="$(echo "$Warning" | sed -r 's|^.+Warning: .+\([0-9]+\) : Warning, (.+)$|\1|')" msg "${YLW}[$I] $FileCompact($Line): $Message"
else
msg "${YLW}[$IW] $FileCompact($Line): $Message" msg "${YLW}[$I] $Message"
((IW+=1)) fi
done ((I+=1))
done < <(grep -P ' Warning:(.+:)? Warning, ' "$1")
fi fi
} }
@ -558,6 +566,10 @@ function compile ()
get_latest_multini "$ThirdPartyBin/multini.exe" get_latest_multini "$ThirdPartyBin/multini.exe"
fi fi
if [[ -z "$PackageBuildOrder" ]]; then
die "No packages found! Check project filesystem, fix config and try again"
fi
multini --del "$KFEditorConf" 'ModPackages' 'ModPackages' multini --del "$KFEditorConf" 'ModPackages' 'ModPackages'
for Package in $PackageBuildOrder for Package in $PackageBuildOrder
do do