Allow further configuration of error patterns

This commit is contained in:
Manuel Thalmann 2023-03-24 22:55:00 +00:00
parent b552242b47
commit e19332314e

View file

@ -51,13 +51,16 @@ RUN \
|| true && \
# Handle console output of MDK537 installer
handle_output() { \
# A pattern that is supposed to indicates that wine got stuck
pattern="fixme:win:NtUserLockWindowUpdate ((nil))"; \
# The amount of times the pattern should occur for the process to be considered stuck
patternCount=2; \
output=$( \
sed \
# Handle exit hints
-e "s/^exit \([[:digit:]]\+\)$/\1/; t end;" \
# Handle multiple occurrences of $pattern
-e "/$pattern/{ x; s/^x\{1\}$/\0/; t stuck; s/^\(x*\)$/\1x/; x; };" \
-e "/$pattern/{ x; s/^x\{$(expr $patternCount - 1)\}$/\0/; t stuck; s/^\(x*\)$/\1x/; x; };" \
# Delete output and return to start
-e "d; b;" \
# Branch "stuck": delete output and exit with code 42