From c0460197b159ffb255c23cff2ad8bfb443db0995 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 8 Dec 2014 19:37:02 +0100 Subject: [PATCH 1/7] add travis configuration to branch --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..11e8517af --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: c +compiler: + - gcc + - clang +script: s/travis-build +before_install: + - sudo apt-get update -qq + - sudo apt-get install -qq libtolua-dev liblua5.1-dev libncurses5-dev libsqlite3-dev libxml2-dev From 06d5175030cf3542715be169e1c14a39d024d252 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 8 Dec 2014 20:03:04 +0100 Subject: [PATCH 2/7] add travis build script to branch --- s/travis-build | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 s/travis-build diff --git a/s/travis-build b/s/travis-build new file mode 100644 index 000000000..b08a5a890 --- /dev/null +++ b/s/travis-build @@ -0,0 +1,16 @@ +#!/bin/sh + +inifile() { +if [ ! -e eressea.ini ]; then +cp conf/eressea.ini . +build/iniparser/inifile eressea.ini add lua:paths lunit:scripts +fi +} + +[ -d build ] || mkdir build +cd build && cmake .. \ + -DCMAKE_MODULE_PATH=$PWD/../cmake/Modules \ + -DCMAKE_BUILD_TYPE=Debug .. && \ +make && cd .. && inifile && +build/eressea/test_eressea && +build/eressea/eressea -v0 scripts/run-tests.lua From 87eb2061f8f6778e960ff91447ff9b53b8fc778e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 8 Dec 2014 20:11:10 +0100 Subject: [PATCH 3/7] fix permissions on build script --- s/travis-build | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 s/travis-build diff --git a/s/travis-build b/s/travis-build old mode 100644 new mode 100755 From 3324ced2b19bf01f00e58c4fdfce70e323381b41 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 11 Dec 2014 10:05:50 +0100 Subject: [PATCH 4/7] Print the full version number in the CR. --- src/creport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/creport.c b/src/creport.c index a56c28888..010926272 100644 --- a/src/creport.c +++ b/src/creport.c @@ -1523,7 +1523,7 @@ report_computer(const char *filename, report_context * ctx, const char *charset) fprintf(F, "%d;Basis\n", 36); fprintf(F, "%d;Runde\n", turn); fprintf(F, "%d;Zeitalter\n", era); - fprintf(F, "%d;Build\n", VERSION_BUILD); + fprintf(F, "%d.%d.%d;Build\n", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); if (mailto != NULL) { fprintf(F, "\"%s\";mailto\n", mailto); fprintf(F, "\"%s\";mailcmd\n", locale_string(f->locale, "mailcmd")); From 1a1ffd06b020b45e23a9cf9b3d44970b9907b72b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 11 Dec 2014 11:14:54 +0100 Subject: [PATCH 5/7] build number update --- src/build.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.h b/src/build.h index 691d9def3..6aab71634 100644 --- a/src/build.h +++ b/src/build.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 3 -#define VERSION_BUILD 690 +#define VERSION_BUILD 692 From e5d53769df025be750b53924957161f0f840a34b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 11 Dec 2014 12:19:04 +0100 Subject: [PATCH 6/7] lock files to prevent accidents. preview will only run if the turn worked out. cannot accidentally run in the game directory. --- process/cron/run-eressea | 6 ++++++ scripts/run-turn.lua | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/process/cron/run-eressea b/process/cron/run-eressea index cc33f8f1e..21de5ee09 100755 --- a/process/cron/run-eressea +++ b/process/cron/run-eressea @@ -13,7 +13,12 @@ if [ -d $REPORTS ]; then fi mkdir $REPORTS $BIN/backup-eressea $GAME +if [ -d test ]; then + touch test/execute.lock +fi +rm -f execute.lock $BIN/run-turn $GAME +touch execute.lock if [ ! -s $ERESSEA/game-$GAME/orders.$TURN ]; then echo "server did not create orders for turn $TURN in game $GAME" exit 2 @@ -31,3 +36,4 @@ $BIN/compress.sh $GAME $TURN $BIN/sendreports.sh $GAME $BIN/backup-eressea $GAME [ $GAME -lt 4 ] && $BIN/send-summary $GAME +rm -f test/execute.lock diff --git a/scripts/run-turn.lua b/scripts/run-turn.lua index f938c8514..46095f216 100644 --- a/scripts/run-turn.lua +++ b/scripts/run-turn.lua @@ -182,6 +182,16 @@ function run_turn(rules) return result end +function file_exists(name) + local f=io.open(name,"r") + if f~=nil then io.close(f) return true else return false end +end + +if file_exists('execute.lock') then + eressea.log.error("Lockfile exists, aborting.") + assert(false) +end + local path = 'scripts' if config.install then path = config.install .. '/' .. path From 1864d1fc86ff46ebf75e01db6b09a85e202f13d5 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 11 Dec 2014 13:02:20 +0100 Subject: [PATCH 7/7] backup correctly after each turn --- process/cron/run-eressea | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process/cron/run-eressea b/process/cron/run-eressea index 21de5ee09..dd995e0ce 100755 --- a/process/cron/run-eressea +++ b/process/cron/run-eressea @@ -34,6 +34,6 @@ if [ ! -s $REPORTS/reports.txt ]; then fi $BIN/compress.sh $GAME $TURN $BIN/sendreports.sh $GAME -$BIN/backup-eressea $GAME +$BIN/backup-eressea $GAME $TURN [ $GAME -lt 4 ] && $BIN/send-summary $GAME rm -f test/execute.lock