OpenTTD/os/debian/openttd-wrapper
rubidium d197bcae1c (svn r19585) [1.0] -Backport from trunk:
- Feature: [NewGRF] Support for extended text code 0x9A 11, print qword (r19570)
- Change: Sync Debian packaging updates from Debian, but keep building a single package (r19572)
- Fix: Crash when pressing 'h' (non-stop) in the order window of a ship or aircraft [FS#3744] (r19584)
- Fix: Graphs were not properly updated when going toggling keys (i.e. companies) (r19574)
- Fix: The timetable button was not automatically raised [FS#3739] (r19571)
- Fix: [NewGRF] Possible buffer underflow in NewGRF string code (r19569)
2010-04-08 15:40:46 +00:00

29 lines
863 B
Bash

#!/bin/sh
# This is a wrapper script that checks openttd's exit status and
# displays its stderr output
# Get a file to capture stderr to. Use the deprecated -t option, so this
# works on the old mktemp from the mktemp package (which has been
# replaced by the version from the coreutils package).
TMPFILE=`mktemp -t openttd.errout.XXXXXXXXX`
if [ ! -w "$TMPFILE" ]; then
xmessage "Could not create temporary file for error messages. Not starting OpenTTD."
exit 1;
fi
# Capture stderr
openttd "$@" 2> "$TMPFILE"
ERRCODE=$?
if [ "$ERRCODE" -ne 0 ]; then
CODEMSG="OpenTTD returned with error code $ERRCODE."
if [ -s "$TMPFILE" ]; then
MESSAGE="$CODEMSG The following error messages were produced:\n\n"
printf "$MESSAGE" | cat - "$TMPFILE" | fold -s | xmessage -file -
else
xmessage "$CODEMSG No error messages were produced."
fi
fi
rm -f "$TMPFILE"