From ea33a19c447df8cc3748a8b6dc8e45121fdc3570 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Wed, 19 May 2021 20:49:04 +0200 Subject: fixed flagstore patch targets and added temp file for keeping track of safe builds without recompiling each run --- service/.gitignore | 1 + service/do.sh | 11 ++++++++--- service/src/.gitignore | 1 - service/src/patches/flagstore1.diff | 6 ++---- service/src/patches/flagstore2.diff | 6 ++---- 5 files changed, 13 insertions(+), 12 deletions(-) (limited to 'service') diff --git a/service/.gitignore b/service/.gitignore index 648ea81..5ca3e64 100644 --- a/service/.gitignore +++ b/service/.gitignore @@ -1,3 +1,4 @@ data/* !data/.keep .cleansrc +src/.safebuild diff --git a/service/do.sh b/service/do.sh index 9a4823d..168d495 100644 --- a/service/do.sh +++ b/service/do.sh @@ -54,14 +54,19 @@ elif [ "$1" == "cleansrc" ]; then elif [ "$1" == "test" ]; then SRCDIR="$PWD/src" DATADIR="$PWD/data" bash "tests/test.sh" ${@:2} elif [ "$1" == "make" ]; then + # build a normal version cd src - - make clean + if [ -e ".safebuild" ]; then + make clean + rm ".safebuild" + fi make elif [ "$1" == "make-safe" ]; then - cd "src" + # build a 'safe' version with flagstore patches + cd src make clean + touch ".safebuild" for f in $(ls | grep '\.[ch]$'); do cp "$f" "safe_$f" diff --git a/service/src/.gitignore b/service/src/.gitignore index edaffd1..5f14e4d 100644 --- a/service/src/.gitignore +++ b/service/src/.gitignore @@ -1,5 +1,4 @@ stldoctor -scans *.o vgcore.* safe_* diff --git a/service/src/patches/flagstore1.diff b/service/src/patches/flagstore1.diff index 0b5fe05..f0f8d4a 100644 --- a/service/src/patches/flagstore1.diff +++ b/service/src/patches/flagstore1.diff @@ -1,7 +1,5 @@ -diff --git a/service/src/util.c b/service/src/util.c -index 31a2628..354bbca 100644 ---- a/service/src/util.c -+++ b/service/src/util.c +--- a/service/src/safe_util.c ++++ b/service/src/safe_util.c @@ -78,13 +78,12 @@ void freadstr(FILE *f, char **dst) { diff --git a/service/src/patches/flagstore2.diff b/service/src/patches/flagstore2.diff index ef6f524..b34a0c0 100644 --- a/service/src/patches/flagstore2.diff +++ b/service/src/patches/flagstore2.diff @@ -1,7 +1,5 @@ -diff --git a/service/src/util.c b/service/src/util.c -index 31a2628..bf272db 100644 ---- a/service/src/util.c -+++ b/service/src/util.c +--- a/service/src/safe_util.c ++++ b/service/src/safe_util.c @@ -58,7 +58,7 @@ mhash(const char *str, int len) srand(v); -- cgit v1.2.3-71-gd317