* [OE-core][zeus][PATCH] cve-update-db-native: clean DB if temporary file exist
@ 2020-05-01 21:59 Adrian Bunk
0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2020-05-01 21:59 UTC (permalink / raw)
To: openembedded-core
From: Lee Chee Yang <chee.yang.lee@intel.com>
when do_populate_cve_db forced stop at certain point, the
DB execution are stoped however the temporary database
file (DB-JOURNAL) are not removed. This db-journal file
indicates that DB is incomplete and set DB in readonly
mode. So when db-journal exist, remove both DB and the
db-journal and build the DB again from scratch.
[YOCTO #13682]
(From OE-Core rev: 70713df25b8ae27a21e53b0b9234567d7053800a)
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
meta/recipes-core/meta/cve-update-db-native.bb | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb
index 1b4f31692b..d69d79cb31 100644
--- a/meta/recipes-core/meta/cve-update-db-native.bb
+++ b/meta/recipes-core/meta/cve-update-db-native.bb
@@ -13,8 +13,15 @@ deltask do_install
deltask do_populate_sysroot
python () {
- if not d.getVar("CVE_CHECK_DB_FILE"):
+ cve_check_db_file = d.getVar("CVE_CHECK_DB_FILE")
+ if not cve_check_db_file:
raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.")
+
+ if os.path.exists("%s-journal" % cve_check_db_file ):
+ os.remove("%s-journal" % cve_check_db_file)
+
+ if os.path.exists(cve_check_db_file):
+ os.remove(cve_check_db_file)
}
python do_populate_cve_db() {
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-05-01 21:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-01 21:59 [OE-core][zeus][PATCH] cve-update-db-native: clean DB if temporary file exist Adrian Bunk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox