summaryrefslogtreecommitdiffstats
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:50:59 +0100
commit2d903126e8bbece3a5171c3488c3deae1f0aa3ee (patch)
tree5570d1acd2a3df69b9538960ee4a45e7f797d24c
parentedc28907ce19a7298059dd388933c58a9c6c28b9 (diff)
downloadopenembedded-core-2d903126e8bbece3a5171c3488c3deae1f0aa3ee.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. Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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
deltask do_install
deltask do_populate_sysroot
+NVDCVE_URL ?= "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-"
+
python () {
if not bb.data.inherits_class("cve-check", d):
raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.")
@@ -28,7 +30,6 @@ python do_fetch() {
bb.utils.export_proxies(d)
- BASE_URL = "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-"
YEAR_START = 2002
db_file = d.getVar("CVE_CHECK_DB_FILE")
@@ -64,7 +65,7 @@ python do_fetch() {
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)
+ year_url = (d.getVar('NVDCVE_URL')) + str(year)
meta_url = year_url + ".meta"
json_url = year_url + ".json.gz"