From 281cfbd0094b3057eb9c4c5b774ec390653be9b3 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 11 Jan 2017 10:57:42 +0100 Subject: [PATCH 1/3] fix the install script, issue #623 --- s/install | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/s/install b/s/install index 18cc2393f..416d07f9a 100755 --- a/s/install +++ b/s/install @@ -10,12 +10,11 @@ done DEST=$(dirname $ROOT)/server -MACHINE=`uname -m` [ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang" [ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" [ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc" [ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc" -BIN_DIR="build-$MACHINE-$CC-Debug" +BIN_DIR="Debug" cd $ROOT/$BIN_DIR make install From 3d8d091207494a65785feb2f61e1c2fe69486f9e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 30 Jan 2017 10:26:08 +0100 Subject: [PATCH 2/3] new build scripts, new versioning system --- s/build | 11 +++++++---- s/cmake-init | 9 +-------- s/runtests | 6 +----- src/kernel/version.c | 2 +- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/s/build b/s/build index b59804626..f471229b8 100755 --- a/s/build +++ b/s/build @@ -1,8 +1,5 @@ #!/bin/sh -ROOT=`pwd` -while [ ! -d $ROOT/.git ]; do - ROOT=`dirname $ROOT` -done +ROOT=$(git rev-parse --show-toplevel) [ -z "$BUILD" ] && BUILD=Debug if [ -z "$JOBS" ] ; then @@ -37,7 +34,13 @@ git submodule update echo "build eressea" cd $ROOT/$BUILD +BRANCH=$(git status -s -b | head -1 | cut -d\ -f 2 | sed 's/\..*//') +if [ "$BRANCH" == "master" ] ; then VERSION=$(git describe --match 'v*.*.*' --tags | sed 's/^v//') cmake -DERESSEA_VERSION="$VERSION" .. +else +REV=$(git rev-parse --short HEAD) +cmake -DERESSEA_BUILDNO="$REV-$BUILD" .. +fi make $MAKEOPTS && make test cd $OLDPWD diff --git a/s/cmake-init b/s/cmake-init index ea94afb7c..370725a4d 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -1,13 +1,6 @@ #!/bin/sh -ROOT=$(pwd) -while [ ! -d $ROOT/.git ]; do - ROOT=$(dirname $ROOT) - if [ "$ROOT" == "/" ; then - echo "could not find root, are you in the git repository?" - exit - fi -done +ROOT=$(git rev-parse --show-toplevel) [ -z $BUILD ] && BUILD=Debug [ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang" [ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" diff --git a/s/runtests b/s/runtests index e0e20b5c7..58498436f 100755 --- a/s/runtests +++ b/s/runtests @@ -1,11 +1,7 @@ #!/bin/bash set -e -ROOT=$(pwd) -while [ ! -d $ROOT/.git ]; do - ROOT=$(dirname $ROOT) -done - +ROOT=$(git rev-parse --show-toplevel) [ -z $BUILD ] && BUILD=Debug ; export BUILD if [ ! -e $ROOT/$BUILD ]; then diff --git a/src/kernel/version.c b/src/kernel/version.c index 6de6ddb40..45b9815bc 100644 --- a/src/kernel/version.c +++ b/src/kernel/version.c @@ -5,7 +5,7 @@ #ifndef ERESSEA_VERSION // the version number, if it was not passed to make with -D -#define ERESSEA_VERSION "3.10.0-devel" +#define ERESSEA_VERSION "3.10.0" #endif const char *eressea_version(void) { From f132dfe4d46b4b3d695c0a4b756c52d075696413 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 12 Feb 2017 19:57:02 +0100 Subject: [PATCH 3/3] bug 2282: Datenfile 2012 kaputt. make the reader for at_keys accept that sometimes, there are 0 keys. --- src/attributes/key.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/attributes/key.c b/src/attributes/key.c index 0b252e0c0..ae15a38e3 100644 --- a/src/attributes/key.c +++ b/src/attributes/key.c @@ -38,7 +38,10 @@ static void a_writekeys(const attrib *a, const void *o, storage *store) { static int a_readkeys(attrib * a, void *owner, gamedata *data) { int i, *p = 0; READ_INT(data->store, &i); - assert(i < 4096 && i>0); + assert(i < 4096 && i>=0); + if (i == 0) { + return AT_READ_FAIL; + } a->data.v = p = malloc(sizeof(int)*(i + 1)); *p++ = i; while (i--) {