@@ -30,6 +30,7 @@ def parse_patches_from_tracker():
30
30
def find_missing_patches (patches , patches_dir ):
31
31
32
32
missing_patches = {}
33
+ missing_tracker_cves = []
33
34
34
35
subdirs = [node for node in os .listdir (patches_dir )
35
36
if os .path .isdir (os .path .join (patches_dir , node ))]
@@ -43,7 +44,17 @@ def find_missing_patches(patches, patches_dir):
43
44
missing .append (patch )
44
45
missing_patches [subdir ] = missing
45
46
46
- return missing_patches
47
+ our_cves = []
48
+ for subdir in subdirs :
49
+ patch_dir = os .path .join (patches_dir , subdir )
50
+ subdir_patches = [os .path .splitext (node )[0 ] for node in os .listdir (patch_dir )]
51
+ our_cves .extend (subdir_patches )
52
+
53
+ for cve in our_cves :
54
+ if cve not in patches :
55
+ missing_tracker_cves .append (cve )
56
+
57
+ return (missing_patches , missing_tracker_cves )
47
58
48
59
49
60
"""
@@ -90,15 +101,20 @@ def main():
90
101
91
102
# query CVE list from Lineage tracker
92
103
patches = parse_patches_from_tracker ()
93
- missing_patches = find_missing_patches (patches , patches_dir )
104
+ ( missing_patches , missing_tracker_cves ) = find_missing_patches (patches , patches_dir )
94
105
95
- print ("missing patchfiles:\n " )
106
+ print ("missing patchfiles for this tool :\n " )
96
107
for subdir in missing_patches :
97
108
print (subdir )
98
109
for patch in missing_patches [subdir ]:
99
110
print ("\t " + patch )
100
111
print ("" )
101
112
113
+ print ("missing CVEs in the tracker:\n " )
114
+ for cve_id in missing_tracker_cves :
115
+ print ("\t " + cve_id )
116
+ print ("" )
117
+
102
118
103
119
if __name__ == "__main__" :
104
120
main ()
0 commit comments