(svn r19162) -Update: the debian packaging; bring it in sync with the packaging used at debian (minus the splitting)

This commit is contained in:
rubidium
2010-02-18 18:20:15 +00:00
parent d06407b06c
commit 6c55e93bf7
27 changed files with 136 additions and 770 deletions

26
os/debian/openttd-wrapper Normal file
View File

@@ -0,0 +1,26 @@
#!/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
TMPFILE=`mktemp --tmpdir 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"