From de9fec8eedac6692c9da1dba3a6a7a316b317a0f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 12 Sep 2015 21:19:44 +0200 Subject: [PATCH 1/3] fix bug in a python script do not install crontab anywhere but eressea@gruenbaer --- process/compress.py | 5 ++--- s/install | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/process/compress.py b/process/compress.py index 243f80d9c..1a9c4cebf 100755 --- a/process/compress.py +++ b/process/compress.py @@ -60,11 +60,10 @@ for line in infile.readlines(): output = "%s%s.bz2" % (prefix, extension) files = files+[output] if access(filename, R_OK): - if (access(output, R_OK)): - #print output, "exists, skipping" + if access(output, R_OK): continue system("bzip2 %s" % filename) - if not access('../wochenbericht.txt'): + if not access('../wochenbericht.txt', R_OK): os.symlink('../parteien', '../wochenbericht.txt') extras = [ '../wochenbericht.txt', '../express.txt' ] for extra in extras: diff --git a/s/install b/s/install index 16109391f..da949f82a 100755 --- a/s/install +++ b/s/install @@ -27,6 +27,5 @@ install -v $ROOT/process/$prg $DEST/bin/ done # install crontab, but only on the eressea server: -HOST=`hostname` - -[ "gruenbaer" = "$HOST" ] && crontab $ROOT/process/cron/crontab +WHOAMI=`whoami`@`hostname` +[ "eressea@gruenbaer" = "$WHOAMI" ] && crontab $ROOT/process/cron/crontab From 7e6312441c3fe02e63b48112665e36922a48db5a Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 12 Sep 2015 21:43:36 +0200 Subject: [PATCH 2/3] cron fixes --- process/compress.py | 22 +++++++++------------- process/cron/crontab | 1 - process/cron/run-eressea.cron | 1 - s/install | 5 +++-- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/process/compress.py b/process/compress.py index 1a9c4cebf..95b725fb0 100755 --- a/process/compress.py +++ b/process/compress.py @@ -2,8 +2,8 @@ from sys import argv, exit from string import join -from os import access, R_OK -from os import system, symlink +import os +import os.path gamename='Eressea' @@ -43,15 +43,13 @@ for line in infile.readlines(): if options["compression"]=="zip": output = prefix+"zip" files = [output] - if (access(output, R_OK)): - pass - else: + if not os.path.isfile(output): parameters = [] for extension in reports: filename = "%s%s" % (prefix, extension) - if (access(filename, R_OK)): + if os.path.isfile(filename): parameters = parameters + [ filename ] - system("zip %s -q -m -j %s" % (output, join(parameters," "))) + os.system("zip %s -q -m -j %s" % (output, join(parameters," "))) else: files = [] for extension in reports: @@ -59,15 +57,13 @@ for line in infile.readlines(): filename = "%s%s" % (prefix, extension) output = "%s%s.bz2" % (prefix, extension) files = files+[output] - if access(filename, R_OK): - if access(output, R_OK): + if os.path.isfile(filename): + if os.path.isfile(output): continue - system("bzip2 %s" % filename) - if not access('../wochenbericht.txt', R_OK): - os.symlink('../parteien', '../wochenbericht.txt') + os.system("bzip2 %s" % filename) extras = [ '../wochenbericht.txt', '../express.txt' ] for extra in extras: - if access(extra, R_OK): + if os.path.isfile(extra): files = files + [extra] options["files"] = join(files, " ") batch = file("%s.sh" % options["faction"], "w") diff --git a/process/cron/crontab b/process/cron/crontab index 8bbabab53..58fbce346 100644 --- a/process/cron/crontab +++ b/process/cron/crontab @@ -2,7 +2,6 @@ PATH=/home/eressea/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin ERESSEA=/home/eressea/eressea -ATLANTIS=/home/eressea/atlantis ENABLED=yes PREVIEW=yes CONFIRM=yes diff --git a/process/cron/run-eressea.cron b/process/cron/run-eressea.cron index 471031237..8b506a633 100755 --- a/process/cron/run-eressea.cron +++ b/process/cron/run-eressea.cron @@ -40,6 +40,5 @@ fi echo "sending reports for game $GAME, turn $TURN" $BIN/compress.sh $GAME $TURN $BIN/sendreports.sh $GAME -[ $GAME -lt 4 ] && $BIN/send-summary $GAME $BIN/backup-eressea $GAME $TURN rm -f test/execute.lock diff --git a/s/install b/s/install index da949f82a..31b94052d 100755 --- a/s/install +++ b/s/install @@ -27,5 +27,6 @@ install -v $ROOT/process/$prg $DEST/bin/ done # install crontab, but only on the eressea server: -WHOAMI=`whoami`@`hostname` -[ "eressea@gruenbaer" = "$WHOAMI" ] && crontab $ROOT/process/cron/crontab +# in fact, never do this, because it overwrites hand-edits +#WHOAMI=`whoami`@`hostname` +#[ "eressea@gruenbaer" = "$WHOAMI" ] && crontab $ROOT/process/cron/crontab From 871373a0e53ddd3dc4727976b376dc99063faba8 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 12 Sep 2015 22:26:54 +0200 Subject: [PATCH 3/3] be less verbose about cursing --- scripts/eressea/cursed.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/eressea/cursed.lua b/scripts/eressea/cursed.lua index ecf4db9de..91c143ed1 100644 --- a/scripts/eressea/cursed.lua +++ b/scripts/eressea/cursed.lua @@ -12,8 +12,6 @@ local function curse(file) elseif not bitset(f.flags, 16) then print("cursing " .. tostring(f)) f.flags = f.flags + 16 - else - print("already cursed: " .. tostring(f)) end end end