mirror of
https://git.yoctoproject.org/poky
synced 2026-09-13 09:49:32 +02:00
cve-update-db-native: log a little more
OE-Core rev: b64a869b9c5e1d504f1011da16b5c5ff721afbf0 This commit was not applied on nvd1/fkie fetcher. (From OE-Core rev: dd5efc4a242ec918dd276d10da8c68f606ba8809) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
42b14b33d0
commit
0844840c7d
@@ -58,7 +58,7 @@ python do_fetch() {
|
|||||||
bb.error("CVE database %s not present, database fetch/update skipped" % db_file)
|
bb.error("CVE database %s not present, database fetch/update skipped" % db_file)
|
||||||
return
|
return
|
||||||
if time.time() - os.path.getmtime(db_file) < update_interval:
|
if time.time() - os.path.getmtime(db_file) < update_interval:
|
||||||
bb.debug(2, "Recently updated, skipping")
|
bb.note("CVE database recently updated, skipping")
|
||||||
return
|
return
|
||||||
|
|
||||||
except OSError:
|
except OSError:
|
||||||
@@ -77,7 +77,7 @@ python do_fetch() {
|
|||||||
shutil.move(db_tmp_file, db_file)
|
shutil.move(db_tmp_file, db_file)
|
||||||
else:
|
else:
|
||||||
# Update failed, do not modify the database
|
# Update failed, do not modify the database
|
||||||
bb.note("CVE database update failed")
|
bb.warn("CVE database update failed")
|
||||||
os.remove(db_tmp_file)
|
os.remove(db_tmp_file)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ def update_db_file(db_tmp_file, d):
|
|||||||
with bb.progress.ProgressHandler(d) as ph, open(os.path.join(d.getVar("TMPDIR"), 'cve_check'), 'a') as cve_f:
|
with bb.progress.ProgressHandler(d) as ph, open(os.path.join(d.getVar("TMPDIR"), 'cve_check'), 'a') as cve_f:
|
||||||
total_years = date.today().year + 1 - YEAR_START
|
total_years = date.today().year + 1 - YEAR_START
|
||||||
for i, year in enumerate(range(YEAR_START, date.today().year + 1)):
|
for i, year in enumerate(range(YEAR_START, date.today().year + 1)):
|
||||||
bb.debug(2, "Updating %d" % year)
|
bb.note("Updating %d" % year)
|
||||||
ph.update((float(i + 1) / total_years) * 100)
|
ph.update((float(i + 1) / total_years) * 100)
|
||||||
json_url, meta_url = db_file_names(d, year, is_nvd)
|
json_url, meta_url = db_file_names(d, year, is_nvd)
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ def update_db_file(db_tmp_file, d):
|
|||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
if not meta or meta[0] != last_modified:
|
if not meta or meta[0] != last_modified:
|
||||||
bb.debug(2, "Updating entries")
|
bb.note("Updating entries")
|
||||||
# Clear products table entries corresponding to current year
|
# Clear products table entries corresponding to current year
|
||||||
conn.execute("delete from PRODUCTS where ID like ?", ('CVE-%d%%' % year,)).close()
|
conn.execute("delete from PRODUCTS where ID like ?", ('CVE-%d%%' % year,)).close()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user