summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorLee Chee Yang <chee.yang.lee@intel.com>2020-05-02 00:59:17 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-07 17:32:09 +0100
commit419d592685965e4b8258da1b806390f8015e9469 (patch)
tree3cfdb7f5bc886a3fad4a39388c41144a9dcb62ba /meta/recipes-core
parent3412c7b7131fb3b94075d5c654df1908701f64a2 (diff)
downloadpoky-419d592685965e4b8258da1b806390f8015e9469.tar.gz
cve-update-db-native: clean DB if temporary file exist
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) (From OE-Core rev: 3f3bdb014cb6d87ee2e22db3c76b99ca6085787a) 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> Signed-off-by: Anuj Mittal <anuj.mittal@intel.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.bb9
1 files changed, 8 insertions, 1 deletions
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
13deltask do_populate_sysroot 13deltask do_populate_sysroot
14 14
15python () { 15python () {
16 if not d.getVar("CVE_CHECK_DB_FILE"): 16 cve_check_db_file = d.getVar("CVE_CHECK_DB_FILE")
17 if not cve_check_db_file:
17 raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.") 18 raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.")
19
20 if os.path.exists("%s-journal" % cve_check_db_file ):
21 os.remove("%s-journal" % cve_check_db_file)
22
23 if os.path.exists(cve_check_db_file):
24 os.remove(cve_check_db_file)
18} 25}
19 26
20python do_populate_cve_db() { 27python do_populate_cve_db() {