]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove bashism from testHeaders.sh
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 22 Aug 2009 11:15:34 +0000 (23:15 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 22 Aug 2009 11:15:34 +0000 (23:15 +1200)
test-suite/testheaders.sh

index 6ab0bde5e6b37e68cf1679f626196794d5db2e1b..5fe91316afaca799984ae90d02a1ff0522fc122f 100755 (executable)
@@ -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