From: Amos Jeffries Date: Sun, 23 Aug 2009 04:23:32 +0000 (+1200) Subject: Remove bashism from testHeaders.sh X-Git-Tag: SQUID_3_1_0_14~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cff005029a1f4f0e9c5075e8cb3e2da060658b6d;p=thirdparty%2Fsquid.git Remove bashism from testHeaders.sh --- diff --git a/test-suite/testheaders.sh b/test-suite/testheaders.sh index 6ab0bde5e6..5fe91316af 100755 --- a/test-suite/testheaders.sh +++ b/test-suite/testheaders.sh @@ -22,23 +22,24 @@ for f in `cd ${dir} && ls -1 *.h 2>/dev/null`; do echo " IGNORED!" continue fi - if [ ${dir}/${f} -nt ./testHeaderDeps_${f/.h/}.o ]; then + hdr=`echo "${f}" | sed s/.h//` + if [ ${dir}/${f} -nt ./testHeaderDeps_${hdr}.o ]; then ( echo "/* This file is AUTOMATICALLY GENERATED. DO NOT ALTER IT */" echo "#include \"${dir}/${f}\" " echo "int main( int argc, char* argv[] ) { return 0; } " - ) >./testHeaderDeps_${f/.h/}.cc + ) >./testHeaderDeps_${hdr}.cc # run compile test on the new file. - # DEBUG: echo "TRY: ${cc} -o testHeaderDeps.o ./testHeaderDeps_${f/.h/}.cc" - ${cc} -o testHeaderDeps_${f/.h/}.o ./testHeaderDeps_${f/.h/}.cc - rm ./testHeaderDeps_${f/.h/}.cc + # DEBUG: echo "TRY: ${cc} -o testHeaderDeps.o ./testHeaderDeps_${hdr}.cc" + ${cc} -o testHeaderDeps_${hdr}.o ./testHeaderDeps_${hdr}.cc + rm ./testHeaderDeps_${hdr}.cc fi - if [ ! -f testHeaderDeps_${f/.h/}.o ]; then + if [ ! -f testHeaderDeps_${hdr}.o ]; then rm testHeaders exit 1 fi echo "OK." # unit-tests require an app to run. # our most-recent object suits this purpose - cp ./testHeaderDeps_${f/.h/}.o ./testHeaders + cp ./testHeaderDeps_${hdr}.o ./testHeaders done