From d9cc5aab1049e05671492b37e93507832189551b Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Sun, 24 Aug 2008 09:09:22 -0600 Subject: [PATCH] Add server.log and journal.log to nightly build Turn on journaling using journal.econfig. Append the server.log and journal.log files to the nightly build log in the SERVERSTOP step. Remove the server.log and journal.log in the SERVERSTART step to ensure only this run's log events are included in the nightly build log. Add the construction of a econfig in the generate step using *.econfig in the patches directory in a same way code patches are applied. The mingw.patch was removed and replaced with the mingw.econfig. The mingw.econfig also required the addition of exports to the win32.i386.config. --- src/scripts/nightly/conf/win32.i386.config | 5 +- src/scripts/nightly/nightlybuild.sh | 67 +++++++++++++++++-- .../nightly/patches/All/journal.econfig | 1 + .../nightly/patches/win32.i386/mingw.econfig | 3 + .../nightly/patches/win32.i386/mingw.patch | 34 ---------- 5 files changed, 70 insertions(+), 40 deletions(-) create mode 100644 src/scripts/nightly/patches/All/journal.econfig create mode 100644 src/scripts/nightly/patches/win32.i386/mingw.econfig delete mode 100644 src/scripts/nightly/patches/win32.i386/mingw.patch diff --git a/src/scripts/nightly/conf/win32.i386.config b/src/scripts/nightly/conf/win32.i386.config index 920360a3..3c293ca1 100644 --- a/src/scripts/nightly/conf/win32.i386.config +++ b/src/scripts/nightly/conf/win32.i386.config @@ -1,9 +1,10 @@ SCRIPTDIR=/home/empire -BOXDIR=boxes +export BOXDIR=boxes LOGDIR=logs -INSTANCE=win32.i386 +export INSTANCE=win32.i386 EMPPORT=8889 NIGHTLY_SKIP_STEP= GITROOT=ssh://ron-VM2/~empire/empserver.git PATH=$PATH:/c/Progra~1/git/bin +export MINGW_DIR="c:/MinGW" diff --git a/src/scripts/nightly/nightlybuild.sh b/src/scripts/nightly/nightlybuild.sh index 9885eda6..0da03094 100755 --- a/src/scripts/nightly/nightlybuild.sh +++ b/src/scripts/nightly/nightlybuild.sh @@ -227,6 +227,49 @@ do break fi + if [ ! -f emp4/etc/empire/econfig ] + then + warn "econfig file is missing" + break + fi + + if ! emp4/sbin/pconfig >emp4/etc/empire/econfig + then + warn "pconfig failed to create econfig file" + break + fi +echo "Applying global econfig patches from ${BOXDIR}/${WORKDIR}/empserver/src/scripts/nightly/patches/All" +for i in "${BOXDIR}/${WORKDIR}/empserver/src/scripts/nightly/patches/All"/*.econfig +do + [ -r "${i}" ] || continue + if "${i}" >>emp4/etc/empire/econfig + then + echo "${i}: OK" + else + echo "========== ${i}: NOT OK! ${?} ==========" + fi +done +echo "Done (econfig patch All)." +echo "" + +LOCALPATCHDIRECTORY="${BOXDIR}/${WORKDIR}/empserver/src/scripts/nightly/patches/${INSTANCE}" +if [ -n "${LOCALPATCHDIRECTORY}" -a -d "${LOCALPATCHDIRECTORY}/." ] +then + echo "Applying system specific econfig patches from ${LOCALPATCHDIRECTORY}:" + for i in "${LOCALPATCHDIRECTORY}"/*.econfig + do + [ -r "${i}" ] || continue + if "${i}" >>emp4/etc/empire/econfig + then + echo "${i}: OK" + else + echo "========== ${i}: NOT OK! ${?} ==========" + fi + done + echo "Done (econfig patch specific)." + echo "" +fi + cd emp4/bin || err "Could not cd to emp4/bin" echo "Determining type of files in bin directory" @@ -242,8 +285,8 @@ do echo "" echo "Running files and fairland" - echo y | ./files || warn "Error running files" - ./fairland -R 1 10 30 >/dev/null || { warn "Error running fairland" ; break ; } + echo y | ./files -e ../etc/empire/econfig || warn "Error running files" + ./fairland -R 1 -e ../etc/empire/econfig 10 30 >/dev/null || { warn "Error running fairland" ; break ; } [ -s "newcap_script" ] || { warn "fairland did not produce newcap_script" ; break ; } echo "Done (files & fairland)." echo "" @@ -262,8 +305,17 @@ do *SERVERSTART*) ;; *) + echo "Removing existing server.log and journal.log" + if [ -f "../var/empire/server.log" ] + then + rm "../var/empire/server.log" + fi + if [ -f "../var/empire/journal.log" ] + then + rm "../var/empire/journal.log" + fi echo "Starting server with -d in the background" - ./emp_server -R 1 -d & + ./emp_server -R 1 -e ../etc/empire/econfig -d 2>/dev/null & PID="$!" sleep 1 kill -0 "${PID}" || { warn "emp_server not running ?" ; break ; } @@ -995,7 +1047,14 @@ EOF echo "Stopping server" trykill "${PID}" echo "Done (kill)." - echo "" +cd "${BOXDIR}/${WORKDIR}/emp4/var/empire" || err "Could not cd to ${BOXDIR}/${WORKDIR}/emp4/var/empire" + echo "-- Start Server Log --" + cat server.log + echo "-- End of Server Log --" + echo "-- Start Journal Log --" + cat journal.log + echo "-- End of Journal Log --" + echo "Server stopped" ;; esac ;; diff --git a/src/scripts/nightly/patches/All/journal.econfig b/src/scripts/nightly/patches/All/journal.econfig new file mode 100644 index 00000000..4ae40f3e --- /dev/null +++ b/src/scripts/nightly/patches/All/journal.econfig @@ -0,0 +1 @@ +echo keep_journal 1 diff --git a/src/scripts/nightly/patches/win32.i386/mingw.econfig b/src/scripts/nightly/patches/win32.i386/mingw.econfig new file mode 100644 index 00000000..17e25c9a --- /dev/null +++ b/src/scripts/nightly/patches/win32.i386/mingw.econfig @@ -0,0 +1,3 @@ +echo data "$MINGW_DIR$BOXDIR/$INSTANCE/emp4/var/empire" +echo info "$MINGW_DIR$BOXDIR/$INSTANCE/emp4/share/empire/info.nr" +echo builtin "$MINGW_DIR$BOXDIR/$INSTANCE/emp4/share/empire/builtin" diff --git a/src/scripts/nightly/patches/win32.i386/mingw.patch b/src/scripts/nightly/patches/win32.i386/mingw.patch deleted file mode 100644 index 16530f74..00000000 --- a/src/scripts/nightly/patches/win32.i386/mingw.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/src/lib/global/path.c.in b/src/lib/global/path.c.in -index a761735..77b9c50 100644 ---- a/src/lib/global/path.c.in -+++ b/src/lib/global/path.c.in -@@ -38,7 +38,7 @@ - #include "optlist.h" - - /* econfig file to try when user doesn't specify one */ --char dflt_econfig[] = "@econfig@"; -+char dflt_econfig[] = "c:/MinGW@econfig@"; - - /* - * Where to find configuration (absolute file name) -@@ -53,17 +53,17 @@ char *custom_tables = ""; - char *schedulefil; - - /* Where to find built-in configuration tables (relative to configdir) */ --char *builtindir_conf = "@builtindir@"; -+char *builtindir_conf = "c:/MinGW@builtindir@"; - /* Where to find built-in configuration tables (absolute) */ - char *builtindir; - - /* Where to find info pages (relative to configdir) */ --char *infodir_conf = "@einfodir@"; -+char *infodir_conf = "c:/MinGW@einfodir@"; - /* Where to find info pages (absolute) */ - char *infodir; - - /* Where this game's data is stored (relative to configdir) */ --char *gamedir_conf = "@gamedir@"; -+char *gamedir_conf = "c:/MinGW@gamedir@"; - /* Where this game's data is stored (absolute) */ - char *gamedir; -