]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
coccinelle: fix distcheck
authorEric Leblond <eric@regit.org>
Fri, 9 Nov 2012 17:41:52 +0000 (18:41 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 9 Nov 2012 18:52:39 +0000 (19:52 +0100)
distcheck is running run_check.sh from another directory and
run_check.sh was not ready for this.

qa/coccinelle/run_check.sh

index a125cdbc8557c7971cd379c4e0b33a110f068dde..d233b6bf9f7cb7b3ec6fcc855a7235a4970baf94 100755 (executable)
@@ -7,19 +7,19 @@ if [ $1 ]; then
                ;;
         *..*) 
                LIST=$(git diff --pretty="format:" --name-only $1 | grep -E '[ch]$')
-               PREFIX="../../"
+               PREFIX=$(git rev-parse --show-toplevel)/
                ;;
        *)
                LIST=$(git show --pretty="format:" --name-only $1 | grep -E '[ch]$')
-               PREFIX="../../"
+               PREFIX=$(git rev-parse --show-toplevel)/
                ;;
        esac
 else
        LIST=$(git ls-tree -r --name-only --full-tree  HEAD src/ | grep -E '*.c$')
-       PREFIX="../../"
+       PREFIX=$(git rev-parse --show-toplevel)/
 fi
 
-for SMPL in *.cocci; do
+for SMPL in $(git rev-parse --show-toplevel)/qa/coccinelle/*.cocci; do
        echo "Testing cocci file: $SMPL"
        for FILE in $LIST ; do
                spatch --very-quiet -sp_file $SMPL --undefined UNITTESTS  $PREFIX$FILE || exit 1;