Index CONFIG_ references in makefiles

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
This commit is contained in:
Maxime Chretien 2020-06-12 15:44:12 +02:00
parent f235d15bbf
commit 603db9e55b
2 changed files with 10 additions and 5 deletions

5
lib.py
View file

@ -207,6 +207,8 @@ def getFileFamily(filename):
# Some files are named like Kconfig-nommu so we only check the first 7 letters
# We also exclude documentation files that can be named kconfig
return 'K' # Kconfig files
elif name.lower()[:8] in ['makefile'] and not ext.lower() in ['.rst']:
return 'M' # Makefiles
else :
return None
@ -215,7 +217,8 @@ def getFileFamily(filename):
compatibility_list = {
'C' : ['C', 'K'],
'K' : ['K'],
'D' : ['D', 'CM']
'D' : ['D', 'CM'],
'M' : ['K']
}
# Check if families are compatible

View file

@ -231,7 +231,7 @@ class UpdateDefs(Thread):
filename = db.file.get(idx)
family = lib.getFileFamily(filename);
if family == None: continue
if family in [None, 'M']: continue
lines = scriptLines('parse-defs', hash, filename, family)
@ -312,7 +312,9 @@ class UpdateRefs(Thread):
if even:
tok = prefix + tok
if db.defs.exists(tok):
if (db.defs.exists(tok) and
(family != 'M' or tok.startswith(b'CONFIG_'))):
# We only index CONFIG_??? in makefiles
if tok in idents:
idents[tok] += ',' + str(line_num)
else:
@ -374,7 +376,7 @@ class UpdateDocs(Thread):
filename = db.file.get(idx)
family = lib.getFileFamily(filename)
if family == None: continue
if family in [None, 'M']: continue
lines = scriptLines('parse-docs', hash, filename)
with docs_lock:
@ -435,7 +437,7 @@ class UpdateComps(Thread):
filename = db.file.get(idx)
family = lib.getFileFamily(filename)
if family in [None, 'K']: continue
if family in [None, 'K', 'M']: continue
lines = compatibles_parser.run(scriptLines('get-blob', hash), family)
comps = {}