diff options
author | Marta Rybczynska <rybczynska@gmail.com> | 2022-06-03 11:09:56 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2022-06-07 08:56:30 -1000 |
commit | 487a53522a739b9a52720c4c40b93f88ad77d242 (patch) | |
tree | e473d142669b77d3ef32c6e20a6a7ce0da5636ad /meta/recipes-core/meta/cve-update-db-native.bb | |
parent | c63d06becc340270573bdef2630749db1f5230d4 (diff) | |
download | openembedded-core-contrib-487a53522a739b9a52720c4c40b93f88ad77d242.tar.gz |
cve-update-db-native: make it possible to disable database updates
Make it possible to disable the database update completely by using
a negative update interval CVE_DB_UPDATE_INTERVAL.
Disabling the update is useful when running multiple parallel builds
when we want to have a control on the database version. This allows
coherent cve-check results without an database update for only
some of the builds.
Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b5c2269240327c2a8f93b9e55354698f52c976f3)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-core/meta/cve-update-db-native.bb')
-rw-r--r-- | meta/recipes-core/meta/cve-update-db-native.bb | 6 |
1 files changed, 4 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 594bf947c8..a49f446a53 100644 --- a/meta/recipes-core/meta/cve-update-db-native.bb +++ b/meta/recipes-core/meta/cve-update-db-native.bb @@ -14,6 +14,7 @@ deltask do_populate_sysroot # CVE database update interval, in seconds. By default: once a day (24*60*60). # Use 0 to force the update +# Use a negative value to skip the update CVE_DB_UPDATE_INTERVAL ?= "86400" python () { @@ -51,8 +52,9 @@ python do_fetch() { try: import time update_interval = int(d.getVar("CVE_DB_UPDATE_INTERVAL")) - if (update_interval < 0): - update_interval = 0 + if update_interval < 0: + bb.note("CVE database update skipped") + return if time.time() - os.path.getmtime(db_file) < update_interval: return |