summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorjan <jan.vermaete@gmail.com>2021-03-29 19:21:52 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-31 08:51:02 +0100
commit7d0988966cc1fd9e93549ca2ec21ac3bc765ceb6 (patch)
tree6e4b0265eb6f685ce145292d4435b6b6c5e6c672 /meta/recipes-core
parent13e372dfd9c2ae792e6588da99c647370c722eb3 (diff)
downloadpoky-7d0988966cc1fd9e93549ca2ec21ac3bc765ceb6.tar.gz
cve-update-db-native: Allow to overrule the URL in a bbappend.
With this small patch, it's possible to overrule the public URL with a local mirror for those without Internet access. (From OE-Core rev: 2d903126e8bbece3a5171c3488c3deae1f0aa3ee) Signed-off-by: Jan Vermaete <jan.vermaete@gmail.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.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