diff options
Diffstat (limited to 'meta/recipes-core/meta')
-rw-r--r-- | meta/recipes-core/meta/cve-update-db-native.bb | 5 |
1 files changed, 4 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 355ee2a2a3..e267671628 100644 --- a/meta/recipes-core/meta/cve-update-db-native.bb +++ b/meta/recipes-core/meta/cve-update-db-native.bb | |||
@@ -75,6 +75,7 @@ python do_fetch() { | |||
75 | with bb.progress.ProgressHandler(d) as ph, open(os.path.join(d.getVar("TMPDIR"), 'cve_check'), 'a') as cve_f: | 75 | with bb.progress.ProgressHandler(d) as ph, open(os.path.join(d.getVar("TMPDIR"), 'cve_check'), 'a') as cve_f: |
76 | total_years = date.today().year + 1 - YEAR_START | 76 | total_years = date.today().year + 1 - YEAR_START |
77 | for i, year in enumerate(range(YEAR_START, date.today().year + 1)): | 77 | for i, year in enumerate(range(YEAR_START, date.today().year + 1)): |
78 | bb.debug(2, "Updating %d" % year) | ||
78 | ph.update((float(i + 1) / total_years) * 100) | 79 | ph.update((float(i + 1) / total_years) * 100) |
79 | year_url = (d.getVar('NVDCVE_URL')) + str(year) | 80 | year_url = (d.getVar('NVDCVE_URL')) + str(year) |
80 | meta_url = year_url + ".meta" | 81 | meta_url = year_url + ".meta" |
@@ -104,6 +105,7 @@ python do_fetch() { | |||
104 | cursor.close() | 105 | cursor.close() |
105 | 106 | ||
106 | if not meta or meta[0] != last_modified: | 107 | if not meta or meta[0] != last_modified: |
108 | bb.debug(2, "Updating entries") | ||
107 | # Clear products table entries corresponding to current year | 109 | # Clear products table entries corresponding to current year |
108 | conn.execute("delete from PRODUCTS where ID like ?", ('CVE-%d%%' % year,)).close() | 110 | conn.execute("delete from PRODUCTS where ID like ?", ('CVE-%d%%' % year,)).close() |
109 | 111 | ||
@@ -117,7 +119,8 @@ python do_fetch() { | |||
117 | cve_f.write('Warning: CVE db update error, CVE data is outdated.\n\n') | 119 | cve_f.write('Warning: CVE db update error, CVE data is outdated.\n\n') |
118 | bb.warn("Cannot parse CVE data (%s), update failed" % e.reason) | 120 | bb.warn("Cannot parse CVE data (%s), update failed" % e.reason) |
119 | return | 121 | return |
120 | 122 | else: | |
123 | bb.debug(2, "Already up to date (last modified %s)" % last_modified) | ||
121 | # Update success, set the date to cve_check file. | 124 | # Update success, set the date to cve_check file. |
122 | if year == date.today().year: | 125 | if year == date.today().year: |
123 | cve_f.write('CVE database update : %s\n\n' % date.today()) | 126 | cve_f.write('CVE database update : %s\n\n' % date.today()) |