summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/meta/cve-update-db-native.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/meta/cve-update-db-native.bb')
-rw-r--r--meta/recipes-core/meta/cve-update-db-native.bb5
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb
index b3dc33734d..25ec6bac71 100644
--- a/meta/recipes-core/meta/cve-update-db-native.bb
+++ b/meta/recipes-core/meta/cve-update-db-native.bb
@@ -12,6 +12,8 @@ deltask do_compile
12deltask do_install 12deltask do_install
13deltask do_populate_sysroot 13deltask do_populate_sysroot
14 14
15NVDCVE_URL ?= "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-"
16
15python () { 17python () {
16 if not bb.data.inherits_class("cve-check", d): 18 if not bb.data.inherits_class("cve-check", d):
17 raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.") 19 raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.")
@@ -28,7 +30,6 @@ python do_fetch() {
28 30
29 bb.utils.export_proxies(d) 31 bb.utils.export_proxies(d)
30 32
31 BASE_URL = "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-"
32 YEAR_START = 2002 33 YEAR_START = 2002
33 34
34 db_file = d.getVar("CVE_CHECK_DB_FILE") 35 db_file = d.getVar("CVE_CHECK_DB_FILE")
@@ -64,7 +65,7 @@ python do_fetch() {
64 for i, year in enumerate(range(YEAR_START, date.today().year + 1)): 65 for i, year in enumerate(range(YEAR_START, date.today().year + 1)):
65 bb.debug(2, "Updating %d" % year) 66 bb.debug(2, "Updating %d" % year)
66 ph.update((float(i + 1) / total_years) * 100) 67 ph.update((float(i + 1) / total_years) * 100)
67 year_url = BASE_URL + str(year) 68 year_url = (d.getVar('NVDCVE_URL')) + str(year)
68 meta_url = year_url + ".meta" 69 meta_url = year_url + ".meta"
69 json_url = year_url + ".json.gz" 70 json_url = year_url + ".json.gz"
70 71