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.
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:
1. Update this timestamp, so this file will be changed and you'll remember

View file

@ -1,6 +1,8 @@
#! /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,21 +1,30 @@
#! /bin/sh
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'`
rel_test=`echo $1 | sed 's,.*testing/btest/,,'`
base=$(echo $1 | sed 's,\.\./,,;s,/,#,g')
rel_test=$(echo $1 | sed 's,.*testing/btest/,,')
export ZEEK_GEN_CPP=1
export ZEEK_CPP_DIR=`pwd`
export ZEEK_CPP_DIR=$(pwd)
# export ZEEK_OPT_FUNCS="<global-stmts>"
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_FILES
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
)