Skip to content

Commit 50cbf26

Browse files
committed
ThinCompilationsDatabase: Fix in the filename matcher
1 parent 5412c7d commit 50cbf26

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

utility/ThinCompilationsDatabase.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,20 @@ def removeDuplicates(inputlist):
141141
outputlist.append(e)
142142
return outputlist
143143

144+
145+
def fileMatchesAnyInSourceFileList(filename, sourcefilelist):
146+
'''returns true if any filename in sourcefilelist matches
147+
filename
148+
149+
items in sourcefilelist will have only paths relativ (to
150+
a git repository); while filename is a fully qualified path
151+
'''
152+
# TODO: item should be at end of filename
153+
for item in sourcefilelist:
154+
if item in filename:
155+
return True
156+
return False
157+
144158
#
145159
# THE MAIN FUNCTION
146160
#
@@ -214,7 +228,7 @@ def main():
214228

215229
# check if this entry is part of the changed source file list
216230
# if yes, continue directly
217-
if checkall==True or (basename in changedsourcefilelist):
231+
if checkall==True or fileMatchesAnyInSourceFileList(filename, changedsourcefilelist):
218232
verboseLog("Adding " + entry['file'] + " because of presence in modify list (or lack thereof)")
219233
outputqueue.put(entry)
220234
continue

0 commit comments

Comments
 (0)