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

60
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|')"
FileUnix="$(cygpath -u "$File")" File="$(echo "$Error" | sed -r 's|^.+Error: ((.+)\(([0-9]+)\) : )?Error,(.+)$|\2|')"
FileCompact="$(echo "$FileUnix" | sed -r "s|^$KFDev(.+)$|\1|")" if [[ -n "$File" ]]; then
Line="$(echo "$Error" | sed -r 's|^.+Error: .+\(([0-9]+)\) : Error,.+$|\1|')" FileUnix="$(cygpath -u "$File")"
Message="$(echo "$Error" | sed -r 's|^.+Error: .+\([0-9]+\) : Error, (.+)$|\1|')" FileCompact="$(echo "$FileUnix" | sed -r "s|^$KFDev(.+)$|\1|")"
Line="$(echo "$Error" | sed -r 's|^.+Error: ((.+)\(([0-9]+)\) : )?Error,(.+)$|\3|')"
msg "${RED}[$IR] $FileCompact($Line): $Message" msg "${RED}[$I] $FileCompact($Line): $Message"
((IR+=1)) else
done msg "${RED}[$I] $Message"
fi
((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|')"
FileUnix="$(cygpath -u "$File")" if echo "$Message" | grep -qF 'Unknown language extension . Defaulting to INT'; then continue; fi
FileCompact="$(echo "$FileUnix" | sed -r "s|^$KFDev(.+)$|\1|")" File="$(echo "$Warning" | sed -r 's|^.+Warning: ((.+)\(([0-9]+)\) : )?Warning,(.+)$|\2|')"
Line="$(echo "$Warning" | sed -r 's|^.+Warning: .+\(([0-9]+)\) : Warning,.+$|\1|')" if [[ -n "$File" ]]; then
Message="$(echo "$Warning" | sed -r 's|^.+Warning: .+\([0-9]+\) : Warning, (.+)$|\1|')" FileUnix="$(cygpath -u "$File")"
FileCompact="$(echo "$FileUnix" | sed -r "s|^$KFDev(.+)$|\1|")"
msg "${YLW}[$IW] $FileCompact($Line): $Message" Line="$(echo "$Warning" | sed -r 's|^.+Warning: ((.+)\(([0-9]+)\) : )?Warning,(.+)$|\3|')"
((IW+=1)) msg "${YLW}[$I] $FileCompact($Line): $Message"
done else
msg "${YLW}[$I] $Message"
fi
((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