]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
coccinelle: fix distcheck 198/head
authorEric Leblond <eric@regit.org>
Fri, 9 Nov 2012 17:41:52 +0000 (18:41 +0100)
committerEric Leblond <eric@regit.org>
Tue, 13 Nov 2012 17:41:21 +0000 (18:41 +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 d80325167de5b9903a82dc8002a31030a305279e..e6252c663c9f41e8c4cd1746e14856b77b5bd3be 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 $PREFIX$FILE || exit 1;