summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2020-09-10 22:04:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-11 18:05:02 +0100
commit9b230584664873af2ab453b8153b1ad276d3b0af (patch)
tree3f992787d9f2d34eb307ee669b592a2fe34b366b /meta/recipes-core
parentd4f0e43bdf1de972e95869f033dd45f8d420c400 (diff)
downloadopenembedded-core-9b230584664873af2ab453b8153b1ad276d3b0af.tar.gz
cve-update-db-native: add more logging when fetching
Add some debug logging when fetching the CVE data. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/meta/cve-update-db-native.bb6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb
index 94367f9a94..27b4c58d4e 100644
--- a/meta/recipes-core/meta/cve-update-db-native.bb
+++ b/meta/recipes-core/meta/cve-update-db-native.bb
@@ -46,6 +46,7 @@ python do_populate_cve_db() {
try:
import time
if time.time() - os.path.getmtime(db_file) < (60*60):
+ bb.debug(2, "Recently updated, skipping")
return
except OSError:
pass
@@ -61,6 +62,7 @@ python do_populate_cve_db() {
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
for i, year in enumerate(range(YEAR_START, date.today().year + 1)):
+ bb.debug(2, "Updating %d" % year)
ph.update((float(i + 1) / total_years) * 100)
year_url = BASE_URL + str(year)
meta_url = year_url + ".meta"
@@ -88,6 +90,7 @@ python do_populate_cve_db() {
c.execute("select DATE from META where YEAR = ?", (year,))
meta = c.fetchone()
if not meta or meta[0] != last_modified:
+ bb.debug(2, "Updating entries")
# Clear products table entries corresponding to current year
c.execute("delete from PRODUCTS where ID like ?", ('CVE-%d%%' % year,))
@@ -101,7 +104,8 @@ python do_populate_cve_db() {
cve_f.write('Warning: CVE db update error, CVE data is outdated.\n\n')
bb.warn("Cannot parse CVE data (%s), update failed" % e.reason)
return
-
+ else:
+ bb.debug(2, "Already up to date (last modified %s)" % last_modified)
# Update success, set the date to cve_check file.
if year == date.today().year:
cve_f.write('CVE database update : %s\n\n' % date.today())