|
15 | 15 | import sqlite3
|
16 | 16 | import tempfile
|
17 | 17 | from datetime import date
|
18 |
| -from os import utime |
19 | 18 | from pathlib import Path
|
20 | 19 | from typing import Any
|
21 | 20 |
|
|
38 | 37 | OLD_CACHE_DIR,
|
39 | 38 | )
|
40 | 39 | from cve_bin_tool.error_handler import ERROR_CODES, CVEDBError, ErrorMode, SigningError
|
41 |
| -from cve_bin_tool.fetch_json_db import Fetch_JSON_DB |
42 | 40 | from cve_bin_tool.log import LOGGER
|
43 | 41 | from cve_bin_tool.util import make_http_requests
|
44 | 42 | from cve_bin_tool.version import check_latest_version
|
@@ -1156,32 +1154,6 @@ def json_to_db_wrapper(self, path, pubkey, ignore_signature, log_signature_error
|
1156 | 1154 | )
|
1157 | 1155 | return -1
|
1158 | 1156 |
|
1159 |
| - def fetch_from_mirror(self, mirror, pubkey, ignore_signature, log_signature_error): |
1160 |
| - """Get JSON information from download mirror.""" |
1161 |
| - if not self.cachedir.exists(): |
1162 |
| - self.cachedir.mkdir() |
1163 |
| - json_db = Fetch_JSON_DB( |
1164 |
| - mirror=mirror, |
1165 |
| - pubkey=pubkey, |
1166 |
| - ignore_signature=ignore_signature, |
1167 |
| - cache_dir=self.cachedir, |
1168 |
| - log_signature_error=log_signature_error, |
1169 |
| - error_mode=self.error_mode, |
1170 |
| - ) |
1171 |
| - run_coroutine(json_db.handle_download()) |
1172 |
| - json_data_path = self.cachedir / "json_data" |
1173 |
| - if (json_data_path / "metadata.json").exists() and self.json_to_db_wrapper( |
1174 |
| - path=json_data_path, |
1175 |
| - pubkey=pubkey, |
1176 |
| - ignore_signature=ignore_signature, |
1177 |
| - log_signature_error=log_signature_error, |
1178 |
| - ) != -1: |
1179 |
| - self.time_of_last_update = json_db.metadata["timestamp"] |
1180 |
| - utime(self.dbpath, (self.time_of_last_update, self.time_of_last_update)) |
1181 |
| - else: |
1182 |
| - self.clear_cached_data() |
1183 |
| - return -1 |
1184 |
| - |
1185 | 1157 | @contextlib.contextmanager
|
1186 | 1158 | def with_cursor(self):
|
1187 | 1159 | """Context manager for database cursor."""
|
|
0 commit comments