From: Dennis Schafroth Date: Mon, 23 Apr 2012 07:11:46 +0000 (+0000) Subject: Fix order: set and test PREFIX before printing X-Git-Tag: v1.6.13~22 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=d0d4cdbdf868f6b17a2c6c0aa5f381d91284c178;p=pazpar2-moved-to-github.git Fix order: set and test PREFIX before printing --- diff --git a/test/run_pazpar2.sh b/test/run_pazpar2.sh index 3a56249..cb6a9b3 100755 --- a/test/run_pazpar2.sh +++ b/test/run_pazpar2.sh @@ -23,6 +23,12 @@ kill_pazpar2() fi } +PREFIX=$1 +if test "x${PREFIX}" = "x"; then + echo Missing prefix for run_pazpar2.sh + exit 1 +fi + # look for curl in PATH oIFS=$IFS IFS=: @@ -43,25 +49,20 @@ GET='$curl --silent --output $OUT2 "$f"' POST='$curl --silent --header "Content-Type: text/xml" --data-binary "@$postfile" --output $OUT2 "$f"' if [ -z "$SKIP_PAZPAR2" ] ; then -# Fire up pazpar2 +# remove log if starting pazpar2 rm -f $PREFIX_pazpar2.log fi -PREFIX=$1 -if test "x${PREFIX}" = "x"; then - echo Missing prefix for run_pazpar2.sh - exit 1 -fi CFG=${PREFIX}.cfg URLS=${PREFIX}.urls VALGRINDLOG=${PREFIX}_valgrind.log if test -n "$PAZPAR2_USE_VALGRIND"; then - valgrind --num-callers=30 --show-reachable=yes --leak-check=full --log-file=$VALGRINDLOG ../src/pazpar2 -X -l pazpar2.log -f ${CFG} >extra_pazpar2.log 2>&1 & + valgrind --num-callers=30 --show-reachable=yes --leak-check=full --log-file=$VALGRINDLOG ../src/pazpar2 -X -l ${PREFIX}_pazpar2.log -f ${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 & elif test -n "$SKIP_PAZPAR2"; then echo "Skipping pazpar2. Must already be running with correct config!!! " else - YAZ_LOG=zoom,zoomdetails,debug,log,fatal ../src/pazpar2 -v loglevel,fatal,warn,log,debug,notime,zoom,zoomdetails -d -X -l ${PREFIX}_pazpar2.log -f ${srcdir}/${CFG} >extra_pazpar2.log 2>&1 & + YAZ_LOG=zoom,zoomdetails,debug,log,fatal ../src/pazpar2 -v loglevel,fatal,warn,log,debug,notime,zoom,zoomdetails -d -X -l ${PREFIX}_pazpar2.log -f ${srcdir}/${CFG} >${PREFIX}_extra_pazpar2.log 2>&1 & fi PP2PID=$!