diff options
Diffstat (limited to 'do.sh')
| -rw-r--r-- | do.sh | 52 |
1 files changed, 18 insertions, 34 deletions
@@ -1,14 +1,15 @@ #!/bin/sh +REPOROOT="$(git rev-parse --show-toplevel)" SCRIPTPATH="$(dirname $(readlink -f "$0"))" cd "$SCRIPTPATH" makefile=" -all: .cleansrc +all: service/.copyts -.cleansrc: src/* +service/.copyts: src/* bash do.sh cleansrc src service/src - touch .cleansrc + touch service/.copyts " shopt -s expand_aliases @@ -51,40 +52,23 @@ elif [ "$1" == "cleansrc" ]; then fi fi done + + # apply patches if requested + if [ ! -z "$PATCHED" ]; then + pushd "$dst" + git apply "$REPOROOT/src/patches/"*.diff + popd + fi elif [ "$1" == "test" ]; then SRCDIR="$PWD/src" DATADIR="$PWD/service/data" bash "tests/test.sh" ${@:2} elif [ "$1" == "make" ]; then - # build a normal version - pushd src - if [ -e ".safebuild" ]; then - make clean - rm ".safebuild" - fi - make - popd -elif [ "$1" == "make-safe" ]; then - # build a 'safe' version with flagstore patches - - pushd src - make clean - touch ".safebuild" - - for f in $(ls | grep '\.[ch]$'); do - cp "$f" "safe_$f" - done - - git apply patches/flagstore1.diff - git apply patches/flagstore2.diff - - PREFIX="safe_" make - - rm safe_* - popd + make -C src else - echo "USAGE: do.sh (compose) [args..]" + echo "USAGE: do.sh (compose|test|cleansrc) [args..]" echo "EXAMPLES:" - echo " do.sh compose up --build # starts the docker container" - echo " do.sh cleansrc <src> <dst> # post-process source files for release" - echo " do.sh make-safe # create patched version of binary" - echo " do.sh test <cmd> # run a test on the binary" + echo " do.sh compose up --build # setup src and start the container" + echo " do.sh test stl-upload test.stl # test the upload of STL files" + echo " do.sh make # build local binary in src" + echo " do.sh cleansrc <src> <dst> # post-process source files for release" + echo " # if \$PATCHED is set, patches are applied" fi |
