format shell scripts per style guide

This commit is contained in:
Vern Paxson 2022-05-13 10:31:27 -07:00
parent 5c3cc4fba8
commit a21d14fbd2
5 changed files with 28 additions and 13 deletions

View file

@ -3,6 +3,10 @@ This is a collection of scripts to support maintenance of -O gen-C++
suite, and are currently tailored for the lead maintainer's own environment. suite, and are currently tailored for the lead maintainer's own environment.
The scripts all assume you're running them from build/ . The scripts all assume you're running them from build/ .
If you make changes to the scripts, format them using
shfmt -w -i 4 -ci *.sh
The maintenance workflow: The maintenance workflow:
1. Update this timestamp, so this file will be changed and you'll remember 1. Update this timestamp, so this file will be changed and you'll remember

View file

@ -1,6 +1,8 @@
#! /bin/sh #! /bin/sh
out=out.`echo $1 | sed 's,\.\./,,;s,/,#,g'` out=out.$(echo $1 | sed 's,\.\./,,;s,/,#,g')
(/bin/echo -n $1" " (
(src/zeek -O gen-C++ --optimize-files=testing/btest --optimize-func="<global-stmts>" $1 >& /dev/null && echo "success") || echo "fail") >CPP-test/$out 2>&1 /bin/echo -n $1" "
(src/zeek -O gen-C++ --optimize-files=testing/btest --optimize-func="<global-stmts>" $1 >&/dev/null && echo "success") || echo "fail"
) >CPP-test/$out 2>&1

View file

@ -1,4 +1,4 @@
#! /bin/sh #! /bin/sh
/bin/echo -n $1" " /bin/echo -n $1" "
(src/zeek --parse-only $1 >& /dev/null && echo "success") || echo "fail" (src/zeek --parse-only $1 >&/dev/null && echo "success") || echo "fail"

View file

@ -1,21 +1,30 @@
#! /bin/sh #! /bin/sh
rm -f CPP-gen.cc rm -f CPP-gen.cc
cp zeek.HOLD src/zeek || (echo Need to create clean zeek.HOLD; exit 1) || exit 1 cp zeek.HOLD src/zeek || (
echo Need to create clean zeek.HOLD
exit 1
) || exit 1
base=`echo $1 | sed 's,\.\./,,;s,/,#,g'` base=$(echo $1 | sed 's,\.\./,,;s,/,#,g')
rel_test=`echo $1 | sed 's,.*testing/btest/,,'` rel_test=$(echo $1 | sed 's,.*testing/btest/,,')
export ZEEK_GEN_CPP=1 export ZEEK_GEN_CPP=1
export ZEEK_CPP_DIR=`pwd` export ZEEK_CPP_DIR=$(pwd)
# export ZEEK_OPT_FUNCS="<global-stmts>" # export ZEEK_OPT_FUNCS="<global-stmts>"
export ZEEK_OPT_FILES="testing/btest" export ZEEK_OPT_FILES="testing/btest"
(cd ../testing/btest; ../../auxil/btest/btest $rel_test) (
cd ../testing/btest
../../auxil/btest/btest $rel_test
)
# export -n ZEEK_GEN_CPP ZEEK_CPP_DIR ZEEK_OPT_FUNCS ZEEK_OPT_FILES # export -n ZEEK_GEN_CPP ZEEK_CPP_DIR ZEEK_OPT_FUNCS ZEEK_OPT_FILES
export -n ZEEK_GEN_CPP ZEEK_CPP_DIR ZEEK_OPT_FILES export -n ZEEK_GEN_CPP ZEEK_CPP_DIR ZEEK_OPT_FILES
ninja ninja
(cd ../testing/btest; ../../auxil/btest/btest -a cpp -d -f ../../build/CPP-test/diag.$base $rel_test) (
cd ../testing/btest
../../auxil/btest/btest -a cpp -d -f ../../build/CPP-test/diag.$base $rel_test
)

View file

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
find ../testing/btest -type f | find ../testing/btest -type f |
egrep -v 'Baseline|\.tmp' | egrep -v 'Baseline|\.tmp' |
egrep '\.(zeek|test)$' | egrep '\.(zeek|test)$' |
sort sort