qa/coccinelle: fix make distcheck

We need to use top_srcdir to know where the sources are. Relative
directory is not enough.
pull/4420/head
Eric Leblond 6 years ago committed by Victor Julien
parent 7a8ddf06de
commit 18a1d93c58

@ -13,7 +13,7 @@ EXTRA_DIST= access-pkt-packet.cocci \
if HAVE_COCCINELLE
struct-flags.cocci:
$(srcdir)/struct-flags.py > $(top_builddir)/qa/coccinelle/struct-flags.cocci
$(srcdir)/struct-flags.py $(top_srcdir)/src > $(top_builddir)/qa/coccinelle/struct-flags.cocci
check: struct-flags.cocci
TOP_BUILDDIR=${abs_top_builddir} TOP_SRCDIR=$(abs_top_srcdir) $(top_srcdir)/qa/coccinelle/run_check.sh

@ -1,9 +1,13 @@
#!/usr/bin/env python
import re
from os import listdir
import sys
import os
from string import Template
SRC_DIR = "../../src/"
if len(sys.argv) == 2:
SRC_DIR = sys.argv[1]
else:
SRC_DIR = "../../src/"
class Structure:
@ -22,10 +26,10 @@ cmd = "grep -h coccinelle ../../src/*[ch] | sed -e 's/.*coccinelle: \(.*\) \*\//
struct_list = []
setter_getter_list = []
dirList = listdir(SRC_DIR)
dirList = os.listdir(SRC_DIR)
for fname in dirList:
if re.search("\.[ch]$", fname):
for line in open(SRC_DIR + fname):
for line in open(os.path.join(SRC_DIR, fname)):
if "coccinelle:" in line:
m = re.search("coccinelle: (.*) \*\/", line)
if "()" not in m.group(1):

Loading…
Cancel
Save