File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ def get_cpe(self, repo_path: Path) -> Optional[str]:
38
38
]
39
39
40
40
common_dependencies : list [str ] = [
41
+ "ada" ,
41
42
"acorn" ,
42
43
"brotli" ,
43
44
"c-ares" ,
@@ -50,7 +51,9 @@ def get_cpe(self, repo_path: Path) -> Optional[str]:
50
51
"npm" ,
51
52
"OpenSSL" ,
52
53
"libuv" ,
54
+ "simdutf" ,
53
55
"uvwasi" ,
56
+ "undici" ,
54
57
"zlib" ,
55
58
]
56
59
@@ -64,6 +67,14 @@ def get_cpe(self, repo_path: Path) -> Optional[str]:
64
67
65
68
66
69
dependencies_info : dict [str , Dependency ] = {
70
+ "ada" : Dependency (
71
+ version_parser = vp .get_ada_version ,
72
+ cpe = CPE (vendor = "ada-url" , product = "ada" ),
73
+ ),
74
+ "simdutf" : Dependency (
75
+ version_parser = vp .get_simdutf_version ,
76
+ cpe = CPE (vendor = "simdutf" , product = "simdutf" ),
77
+ ),
67
78
"zlib" : Dependency (
68
79
version_parser = vp .get_zlib_version ,
69
80
cpe = CPE (vendor = "zlib" , product = "zlib" ),
Original file line number Diff line number Diff line change @@ -204,3 +204,17 @@ def get_zlib_version(repo_path: Path) -> str:
204
204
if matches is None :
205
205
raise RuntimeError ("Error extracting version number for zlib" )
206
206
return matches .groupdict ()["version" ]
207
+
208
+ def get_simdutf_version (repo_path : Path ) -> str :
209
+ with open (repo_path / "deps/simdutf/simdutf.h" , "r" ) as f :
210
+ matches = re .search ('#define SIMDUTF_VERSION "(?P<version>.*)"' , f .read ())
211
+ if matches is None :
212
+ raise RuntimeError ("Error extracting version number for simdutf" )
213
+ return matches .groupdict ()["version" ]
214
+
215
+ def get_ada_version (repo_path : Path ) -> str :
216
+ with open (repo_path / "deps/ada/ada.h" , "r" ) as f :
217
+ matches = re .search ('#define ADA_VERSION "(?P<version>.*)"' , f .read ())
218
+ if matches is None :
219
+ raise RuntimeError ("Error extracting version number for ada" )
220
+ return matches .groupdict ()["version" ]
You can’t perform that action at this time.
0 commit comments